Skip to content

Commit da44737

Browse files
committed
(PUP-11699) Support ruby-openssl 3 immutable keys
OpenSSL::PKey instances are now immutable in ruby-openssl 3. So set the EC key directly on the certificate request instead of creating a new instance.
1 parent f478bd0 commit da44737

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/puppet/ssl/certificate_request.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ def generate(key, options = {})
6868
csr.public_key = if key.is_a?(OpenSSL::PKey::EC)
6969
# EC#public_key doesn't follow the PKey API,
7070
# see https://github.com/ruby/openssl/issues/29
71-
point = key.public_key
72-
pubkey = OpenSSL::PKey::EC.new(point.group)
73-
pubkey.public_key = point
74-
pubkey
71+
key
7572
else
7673
key.public_key
7774
end

0 commit comments

Comments
 (0)