Skip to content

Commit 9e14a62

Browse files
stousethsbt
authored andcommitted
Expose SSLContext#extra_chain_cert in Net::HTTP
Currently, Net::HTTP can only send a single SSL certificate when it establishes a connection. Some use-cases involve sending an entire certificate chain to the destination; for this, SSLContext supports assigning to #extra_chain_cert=. This adds support in Net::HTTP for exposing this underlying SSLContext property to end-users. [Feature #9758]
1 parent c154a12 commit 9e14a62

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/net/http.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ def use_ssl=(flag)
851851
:@cert,
852852
:@cert_store,
853853
:@ciphers,
854+
:@extra_chain_cert,
854855
:@key,
855856
:@ssl_timeout,
856857
:@ssl_version,
@@ -867,6 +868,7 @@ def use_ssl=(flag)
867868
:cert,
868869
:cert_store,
869870
:ciphers,
871+
:extra_chain_cert
870872
:key,
871873
:ssl_timeout,
872874
:ssl_version,
@@ -897,6 +899,10 @@ def use_ssl=(flag)
897899
# Sets the available ciphers. See OpenSSL::SSL::SSLContext#ciphers=
898900
attr_accessor :ciphers
899901

902+
# Sets the extra X509 certificates to be added to the certificate chain.
903+
# See OpenSSL::SSL::SSLContext#extra_chain_cert=
904+
attr_accessor :extra_chain_cert
905+
900906
# Sets an OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.
901907
# (This method is appeared in Michal Rokos's OpenSSL extension.)
902908
attr_accessor :key

0 commit comments

Comments
 (0)