diff options
| author | Cristian RodrÃguez <yo@cristianrodriguez.net> | 2011-08-15 17:55:58 -0300 |
|---|---|---|
| committer | Cristian RodrÃguez <yo@cristianrodriguez.net> | 2011-08-15 17:55:58 -0300 |
| commit | e6f3c781038de68c6eb24e7c1532ee3fcc3a9c93 (patch) | |
| tree | 5c4adf8ea5fb7182c3f756435b0759a9e08a3b2a /src/LibsslTLSContext.cc | |
| parent | fd3e7671a5429594ba26a98d43c8271c26b15f1d (diff) | |
- Disable SSLv2 and enable all workarounds for buggy servers
- Keep memory usage low when openSSL supports SSL_MODE_RELEASE_BUFFERS
Diffstat (limited to 'src/LibsslTLSContext.cc')
| -rw-r--r-- | src/LibsslTLSContext.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/LibsslTLSContext.cc b/src/LibsslTLSContext.cc index 273ff2f9..272f8cd3 100644 --- a/src/LibsslTLSContext.cc +++ b/src/LibsslTLSContext.cc @@ -55,7 +55,14 @@ TLSContext::TLSContext() A2_LOG_ERROR(fmt("SSL_CTX_new() failed. Cause: %s", 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_CTX_set_mode(sslCtx_, SSL_MODE_AUTO_RETRY); + #ifdef SSL_MODE_RELEASE_BUFFERS + /* keep memory usage low */ + SSL_CTX_set_mode(sslCtx_, SSL_MODE_RELEASE_BUFFERS); + #endif + } TLSContext::~TLSContext() |
