aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-14 14:09:45 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-04-21 00:46:34 +0900
commitee001f2601c0adb4ff3387495bf1450f82ae1ec2 (patch)
treea665ceeec3f4af1fd7ec2757041ae7822a6c1e17
parente4b37492637a697c7d0d10adcd088fe0788b10ad (diff)
downloadruby-ee001f2601c0adb4ff3387495bf1450f82ae1ec2.tar.gz
polyfill for SSL_CTX_get_ciphers
-rw-r--r--ext/openssl/extconf.rb3
-rw-r--r--ext/openssl/openssl_missing.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 330d300127..d1d5d852c1 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -138,7 +138,8 @@ have_func("TLSv1_2_server_method")
have_func("TLSv1_2_client_method")
have_func("SSL_CTX_set_alpn_select_cb")
have_func("SSL_CTX_set_next_proto_select_cb")
-have_func("SSL_CTX_set_tmp_ecdh_callback") # workaround: 1.1.0 removed this
+have_func("SSL_CTX_set_tmp_ecdh_callback")
+have_func("SSL_CTX_get_ciphers")
have_func_or_macro("SSL_CTX_set1_curves_list", "openssl/ssl.h")
have_macro("SSL_get_server_tmp_key", ['openssl/ssl.h']) && $defs.push("-DHAVE_SSL_GET_SERVER_TMP_KEY")
unless have_func("SSL_set_tlsext_host_name", ['openssl/ssl.h'])
diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h
index 4e0f2a01de..02a50fbd95 100644
--- a/ext/openssl/openssl_missing.h
+++ b/ext/openssl/openssl_missing.h
@@ -243,6 +243,10 @@ int SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len);
int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b);
#endif
+#if !defined(HAVE_SSL_CTX_GET_CIPHERS)
+static inline STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(SSL_CTX *ctx) { return ctx->cipher_list; }
+#endif
+
/* reference counter */
#if !defined(HAVE_X509_UP_REF)
# define X509_up_ref(x) \