TLS: new method to specify SSL/TLS version

SSL/TLS protocols only listed in ssl_protocols should be used.
The name "ssl_protocols" comes from nginx.

Resolves #428.
This commit is contained in:
Koichiro IWAO
2016-12-13 15:49:13 +09:00
committed by metalefty
parent 657f6f3756
commit e94ab10e14
8 changed files with 49 additions and 16 deletions
+7 -6
View File
@@ -535,7 +535,7 @@ ssl_tls_print_error(const char *func, SSL *connection, int value)
/*****************************************************************************/
int APP_CC
ssl_tls_accept(struct ssl_tls *self, int disableSSLv3,
ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
const char *tls_ciphers)
{
int connection_status;
@@ -544,13 +544,14 @@ ssl_tls_accept(struct ssl_tls *self, int disableSSLv3,
/**
* SSL_OP_NO_SSLv2
* SSLv3 is used by, eg. Microsoft RDC for Mac OS X.
* No SSLv3 if disableSSLv3=yes so only tls used
*/
options |= SSL_OP_NO_SSLv2;
if (disableSSLv3)
{
options |= SSL_OP_NO_SSLv3;
}
/**
* Disable SSL protocols not listed in ssl_protocols.
*/
options |= ssl_protocols;
#if defined(SSL_OP_NO_COMPRESSION)
/**