28 #ifndef SSL_CTX_set_min_proto_version
37 #error OpenSSL version mismatch
43 int ssl_options = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
45 if (version > TLS1_VERSION)
46 ssl_options |= SSL_OP_NO_TLSv1;
54 if (version > TLS1_1_VERSION)
56 #ifdef SSL_OP_NO_TLSv1_1
57 ssl_options |= SSL_OP_NO_TLSv1_1;
64 if (version > TLS1_2_VERSION)
66 #ifdef SSL_OP_NO_TLSv1_2
67 ssl_options |= SSL_OP_NO_TLSv1_2;
74 SSL_CTX_set_options(ctx, ssl_options);
92 if (version < TLS1_1_VERSION)
94 #ifdef SSL_OP_NO_TLSv1_1
95 ssl_options |= SSL_OP_NO_TLSv1_1;
101 #ifdef TLS1_2_VERSION
102 if (version < TLS1_2_VERSION)
104 #ifdef SSL_OP_NO_TLSv1_2
105 ssl_options |= SSL_OP_NO_TLSv1_2;
112 SSL_CTX_set_options(ctx, ssl_options);
Assert(fmt[strlen(fmt) - 1] !='\n')
int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version)
int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, int version)