summaryrefslogtreecommitdiff
path: root/lib/webrick/https.rb
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-04 23:48:13 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-04 23:48:13 +0000
commitd193b90d54419e253b48aff340887899230d6e63 (patch)
treeb78c3376c00915cedf4e3188c9bb6c8a5f16984c /lib/webrick/https.rb
parent667bdeb0724cb33eb589b25463bb8e8ec17272bf (diff)
* lib/webrick/https.rb (HTTPRequest#parse): set @client_cert_chain.
* lib/webrick/https.rb (HTTPRequest#meta_vars): create SSL_CLIENT_CERT_CHAIN_n from @client_cert_chain. * ext/openssl/ossl_ssl.c (ossl_ssl_get_peer_cert_chain): return nil if no cert-chain was given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/https.rb')
-rw-r--r--lib/webrick/https.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/webrick/https.rb b/lib/webrick/https.rb
index 4e44cfab32..0d8ebd2ba3 100644
--- a/lib/webrick/https.rb
+++ b/lib/webrick/https.rb
@@ -24,6 +24,7 @@ module WEBrick
if socket && socket.is_a?(OpenSSL::SSL::SSLSocket)
@server_cert = @config[:SSLCertificate]
@client_cert = socket.peer_cert
+ @client_cert_chain = socket.peer_cert_chain
@cipher = socket.cipher
end
orig_parse(socket)
@@ -46,6 +47,11 @@ module WEBrick
meta["HTTPS"] = "on"
meta["SSL_SERVER_CERT"] = @server_cert.to_pem
meta["SSL_CLIENT_CERT"] = @client_cert ? @client_cert.to_pem : ""
+ if @client_cert_chain
+ @client_cert_chain.each_with_index{|cert, i|
+ meta["SSL_CLIENT_CERT_CHAIN_#{i}"] = cert.to_pem
+ }
+ end
meta["SSL_CIPHER"] = @cipher[0]
end
meta