From 483c2aa207fd3a3fec48b0647b17a7e2aeb96810 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Tue, 12 Apr 2016 10:08:21 +0900 Subject: use new (will be in 1.1.0-pre5) SSL_CTX_get_ciphers() --- ext/openssl/ossl_ssl.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 6156a64caf..66549fae1f 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -895,7 +895,6 @@ static VALUE ossl_sslctx_get_ciphers(VALUE self) { SSL_CTX *ctx; - SSL *temp_ssl; STACK_OF(SSL_CIPHER) *ciphers; const SSL_CIPHER *cipher; VALUE ary; @@ -906,14 +905,8 @@ ossl_sslctx_get_ciphers(VALUE self) rb_warning("SSL_CTX is not initialized."); return Qnil; } - /* SSL_CTX was made opaque so we can't access ctx->cipher_list directly :( */ - temp_ssl = SSL_new(ctx); - if (!temp_ssl) - ossl_raise(eSSLError, "SSL_new() failed"); - - ciphers = SSL_get_ciphers(temp_ssl); - SSL_free(temp_ssl); + ciphers = SSL_CTX_get_ciphers(ctx); if (!ciphers) return rb_ary_new(); -- cgit v1.2.3