Check SSL_OP_NO_COMPRESSION is available before using it

pull/43/head
Tatsuhiro Tsujikawa 2013-01-27 17:32:06 +09:00
parent a722500d62
commit 988878930e
1 changed files with 5 additions and 2 deletions

View File

@ -57,8 +57,11 @@ TLSContext::TLSContext(TLSSessionSide side)
ERR_error_string(ERR_get_error(), 0)));
}
// Disable SSLv2 and enable all workarounds for buggy servers
SSL_CTX_set_options(sslCtx_, SSL_OP_ALL|SSL_OP_NO_SSLv2|
SSL_OP_NO_COMPRESSION);
SSL_CTX_set_options(sslCtx_, SSL_OP_ALL | SSL_OP_NO_SSLv2
#ifdef SSL_OP_NO_COMPRESSION
| SSL_OP_NO_COMPRESSION
#endif // SSL_OP_NO_COMPRESSION
);
SSL_CTX_set_mode(sslCtx_, SSL_MODE_AUTO_RETRY);
SSL_CTX_set_mode(sslCtx_, SSL_MODE_ENABLE_PARTIAL_WRITE);
#ifdef SSL_MODE_RELEASE_BUFFERS