Skip to content

openssl reads cert.pem in two-byte increments on Windows #786

@joshcooper

Description

@joshcooper

Describe the Bug

openssl shipped in the runtime inefficiently reads cert.pem on Windows. A simple puppet --version results in 116k calls to ReadFile with a two-byte buffer as can be seen from Process Monitor:

Process Monitor

Expected Behavior

It should use buffered reads

Steps to Reproduce

Steps to reproduce the behavior:

  1. Install puppet-agent 8.4.0
  2. Start process monitor and filter on process name ruby.exe
  3. Run puppet --version

Environment

C:\ProgramData\PuppetLabs>ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw32]

C:\ProgramData\PuppetLabs>openssl version
OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023)

C:\ProgramData\PuppetLabs>puppet --version
8.4.0

Additional Context

This might be a bug in upstream openssl 3.0.x. Need to check if puppet-agent 7.x/openssl 1.1.1 has the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriagedJira issue has been created for this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions