|
11 | 11 | */ |
12 | 12 | #include "ossl.h" |
13 | 13 |
|
| 14 | +#ifndef OPENSSL_NO_SOCK |
14 | 15 | #define numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0])) |
15 | 16 |
|
16 | 17 | #if !defined(TLS1_3_VERSION) && \ |
@@ -1537,7 +1538,6 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self) |
1537 | 1538 | /* |
1538 | 1539 | * SSLSocket class |
1539 | 1540 | */ |
1540 | | -#ifndef OPENSSL_NO_SOCK |
1541 | 1541 | static inline int |
1542 | 1542 | ssl_started(SSL *ssl) |
1543 | 1543 | { |
@@ -2565,6 +2565,7 @@ Init_ossl_ssl(void) |
2565 | 2565 | rb_mWaitWritable = rb_define_module_under(rb_cIO, "WaitWritable"); |
2566 | 2566 | #endif |
2567 | 2567 |
|
| 2568 | +#ifndef OPENSSL_NO_SOCK |
2568 | 2569 | id_call = rb_intern_const("call"); |
2569 | 2570 | ID_callback_state = rb_intern_const("callback_state"); |
2570 | 2571 |
|
@@ -2939,9 +2940,6 @@ Init_ossl_ssl(void) |
2939 | 2940 | * Document-class: OpenSSL::SSL::SSLSocket |
2940 | 2941 | */ |
2941 | 2942 | cSSLSocket = rb_define_class_under(mSSL, "SSLSocket", rb_cObject); |
2942 | | -#ifdef OPENSSL_NO_SOCK |
2943 | | - rb_define_method(cSSLSocket, "initialize", rb_f_notimplement, -1); |
2944 | | -#else |
2945 | 2943 | rb_define_alloc_func(cSSLSocket, ossl_ssl_s_alloc); |
2946 | 2944 | rb_define_method(cSSLSocket, "initialize", ossl_ssl_initialize, -1); |
2947 | 2945 | rb_undef_method(cSSLSocket, "initialize_copy"); |
@@ -2976,7 +2974,6 @@ Init_ossl_ssl(void) |
2976 | 2974 | # ifndef OPENSSL_NO_NEXTPROTONEG |
2977 | 2975 | rb_define_method(cSSLSocket, "npn_protocol", ossl_ssl_npn_protocol, 0); |
2978 | 2976 | # endif |
2979 | | -#endif |
2980 | 2977 |
|
2981 | 2978 | rb_define_const(mSSL, "VERIFY_NONE", INT2NUM(SSL_VERIFY_NONE)); |
2982 | 2979 | rb_define_const(mSSL, "VERIFY_PEER", INT2NUM(SSL_VERIFY_PEER)); |
@@ -3138,4 +3135,5 @@ Init_ossl_ssl(void) |
3138 | 3135 | DefIVarID(io); |
3139 | 3136 | DefIVarID(context); |
3140 | 3137 | DefIVarID(hostname); |
| 3138 | +#endif /* !defined(OPENSSL_NO_SOCK) */ |
3141 | 3139 | } |
0 commit comments