summaryrefslogtreecommitdiff
path: root/ext/openssl/lib/openssl
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-04 23:56:44 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-04 23:56:44 +0000
commit1cb9949fad84d2e9305d042229fc06a4488189d6 (patch)
treeb5c7b5c7707fb61ed0e6f4b1403dd82f297d64c9 /ext/openssl/lib/openssl
parent6373a1acc65fb765ea280bd02d27980369044725 (diff)
* ext/openssl/lib/openssl/ssl.rb (module OpenSSL): extract callback
lookup to private Ruby methods. This means we can keep the default DH callback logic hidden from consumers. Also, since the SSLSocket always has a context, we can remove conditionals about that instance. * ext/openssl/ossl_ssl.c: move callback lookup methods to private Ruby methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/lib/openssl')
-rw-r--r--ext/openssl/lib/openssl/ssl.rb26
1 files changed, 21 insertions, 5 deletions
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb
index d50f05851d..cfa2a0c117 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -92,7 +92,7 @@ module OpenSSL
# The callback must return an OpenSSL::PKey::DH instance of the correct
# key length.
- attr_writer :tmp_dh_callback
+ attr_accessor :tmp_dh_callback
# call-seq:
# SSLContext.new => ctx
@@ -125,10 +125,6 @@ module OpenSSL
end
return params
end
-
- def tmp_dh_callback
- @tmp_dh_callback || OpenSSL::PKey::DEFAULT_TMP_DH_CALLBACK
- end
end
module SocketForwarder
@@ -290,6 +286,26 @@ module OpenSSL
ctx.ciphers = "aNULL"
ctx.ciphers.include?(cipher)
end
+
+ def client_cert_cb
+ @context.client_cert_cb
+ end
+
+ def tmp_dh_callback
+ @context.tmp_dh_callback || OpenSSL::PKey::DEFAULT_TMP_DH_CALLBACK
+ end
+
+ def tmp_ecdh_callback
+ @context.tmp_ecdh_callback
+ end
+
+ def session_new_cb
+ @context.session_new_cb
+ end
+
+ def session_get_cb
+ @context.session_get_cb
+ end
end
##