aboutsummaryrefslogtreecommitdiffstats
path: root/lib/openssl
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2021-03-18 20:04:59 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-09-26 17:33:14 +0900
commitaa43da4f0459308e8767bcaa2ad1fec9b5bcf45f (patch)
tree3cc4cbff4359144af07555d91ac71ea885b6fbf9 /lib/openssl
parentbef9ea84e4adb6b56f4497c0174e2b0270a88086 (diff)
downloadruby-openssl-aa43da4f0459308e8767bcaa2ad1fec9b5bcf45f.tar.gz
ssl: add SSLContext#tmp_dh=ky/ssl-set-tmp-dh
Provide a wrapper of SSL_set0_tmp_dh_pkey()/SSL_CTX_set_tmp_dh(), which sets the DH parameters used for ephemeral DH key exchange. SSLContext#tmp_dh_callback= already exists for this purpose, as a wrapper around SSL_CTX_set_tmp_dh_callback(), but it is considered obsolete and the OpenSSL API is deprecated for future removal. There is no practical use case where an application needs to use different DH parameters nowadays. This was originally introduced to support export grade ciphers. RDoc for #tmp_dh_callback= is updated to recommend the new #tmp_dh=. Note that current versions of OpenSSL support automatic ECDHE curve selection which is enabled by default. SSLContext#tmp_dh= should only be necessary if you must allow ancient clients which don't support ECDHE.
Diffstat (limited to 'lib/openssl')
-rw-r--r--lib/openssl/ssl.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/openssl/ssl.rb b/lib/openssl/ssl.rb
index f729a765..a9103ecd 100644
--- a/lib/openssl/ssl.rb
+++ b/lib/openssl/ssl.rb
@@ -91,15 +91,17 @@ YoaOffgTf5qxiwkjnlVZQc3whgnEt9FpVMvQ9eknyeGB5KHfayAc3+hUAvI3/Cr3
DEFAULT_CERT_STORE.set_default_paths
DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
- # A callback invoked when DH parameters are required.
+ # A callback invoked when DH parameters are required for ephemeral DH key
+ # exchange.
#
- # The callback is invoked with the Session for the key exchange, an
+ # The callback is invoked with the SSLSocket, a
# flag indicating the use of an export cipher and the keylength
# required.
#
# The callback must return an OpenSSL::PKey::DH instance of the correct
# key length.
-
+ #
+ # <b>Deprecated in version 3.0.</b> Use #tmp_dh= instead.
attr_accessor :tmp_dh_callback
# A callback invoked at connect time to distinguish between multiple