1111 */
1212#include "ossl.h"
1313
14+ #ifndef OPENSSL_NO_SOCK
1415#define numberof (ary ) (int)(sizeof(ary)/sizeof((ary)[0]))
1516
1617#if !defined(OPENSSL_NO_NEXTPROTONEG ) && !OSSL_IS_LIBRESSL
3334} while (0)
3435
3536VALUE mSSL ;
36- static VALUE mSSLExtConfig ;
3737static VALUE eSSLError ;
3838VALUE cSSLContext ;
3939VALUE cSSLSocket ;
@@ -1541,7 +1541,6 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self)
15411541/*
15421542 * SSLSocket class
15431543 */
1544- #ifndef OPENSSL_NO_SOCK
15451544static inline int
15461545ssl_started (SSL * ssl )
15471546{
@@ -2569,6 +2568,7 @@ Init_ossl_ssl(void)
25692568 rb_mWaitWritable = rb_define_module_under (rb_cIO , "WaitWritable" );
25702569#endif
25712570
2571+ #ifndef OPENSSL_NO_SOCK
25722572 id_call = rb_intern_const ("call" );
25732573 ID_callback_state = rb_intern_const ("callback_state" );
25742574
@@ -2591,16 +2591,6 @@ Init_ossl_ssl(void)
25912591 */
25922592 mSSL = rb_define_module_under (mOSSL , "SSL" );
25932593
2594- /* Document-module: OpenSSL::ExtConfig
2595- *
2596- * This module contains configuration information about the SSL extension,
2597- * for example if socket support is enabled, or the host name TLS extension
2598- * is enabled. Constants in this module will always be defined, but contain
2599- * +true+ or +false+ values depending on the configuration of your OpenSSL
2600- * installation.
2601- */
2602- mSSLExtConfig = rb_define_module_under (mOSSL , "ExtConfig" );
2603-
26042594 /* Document-class: OpenSSL::SSL::SSLError
26052595 *
26062596 * Generic error class raised by SSLSocket and SSLContext.
@@ -2763,8 +2753,6 @@ Init_ossl_ssl(void)
27632753 */
27642754 rb_attr (cSSLContext , rb_intern_const ("session_remove_cb" ), 1 , 1 , Qfalse );
27652755
2766- rb_define_const (mSSLExtConfig , "HAVE_TLSEXT_HOST_NAME" , Qtrue );
2767-
27682756 /*
27692757 * A callback invoked whenever a new handshake is initiated on an
27702758 * established connection. May be used to disable renegotiation entirely.
@@ -2955,11 +2943,6 @@ Init_ossl_ssl(void)
29552943 * Document-class: OpenSSL::SSL::SSLSocket
29562944 */
29572945 cSSLSocket = rb_define_class_under (mSSL , "SSLSocket" , rb_cObject );
2958- #ifdef OPENSSL_NO_SOCK
2959- rb_define_const (mSSLExtConfig , "OPENSSL_NO_SOCK" , Qtrue );
2960- rb_define_method (cSSLSocket , "initialize" , rb_f_notimplement , -1 );
2961- #else
2962- rb_define_const (mSSLExtConfig , "OPENSSL_NO_SOCK" , Qfalse );
29632946 rb_define_alloc_func (cSSLSocket , ossl_ssl_s_alloc );
29642947 rb_define_method (cSSLSocket , "initialize" , ossl_ssl_initialize , -1 );
29652948 rb_undef_method (cSSLSocket , "initialize_copy" );
@@ -2994,7 +2977,6 @@ Init_ossl_ssl(void)
29942977# ifdef OSSL_USE_NEXTPROTONEG
29952978 rb_define_method (cSSLSocket , "npn_protocol" , ossl_ssl_npn_protocol , 0 );
29962979# endif
2997- #endif
29982980
29992981 rb_define_const (mSSL , "VERIFY_NONE" , INT2NUM (SSL_VERIFY_NONE ));
30002982 rb_define_const (mSSL , "VERIFY_PEER" , INT2NUM (SSL_VERIFY_PEER ));
@@ -3156,4 +3138,5 @@ Init_ossl_ssl(void)
31563138 DefIVarID (io );
31573139 DefIVarID (context );
31583140 DefIVarID (hostname );
3141+ #endif /* !defined(OPENSSL_NO_SOCK) */
31593142}
0 commit comments