From ee001f2601c0adb4ff3387495bf1450f82ae1ec2 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Thu, 14 Apr 2016 14:09:45 +0900 Subject: polyfill for SSL_CTX_get_ciphers --- ext/openssl/extconf.rb | 3 ++- ext/openssl/openssl_missing.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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) \ -- cgit v1.2.3