Disable TLS renegotiation if supported

The API doesn't need it and a customer's security scanner
is afraid of a potential DoS attack vector.
This commit is contained in:
Alexander A. Klimov 2023-11-24 16:37:04 +01:00
parent 2d167ccd28
commit f95c4d302a

View File

@ -91,6 +91,10 @@ static void InitSslContext(const Shared<boost::asio::ssl::context>::Ptr& context
flags |= SSL_OP_CIPHER_SERVER_PREFERENCE;
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
flags |= SSL_OP_NO_RENEGOTIATION;
#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */
SSL_CTX_set_options(sslContext, flags);
SSL_CTX_set_mode(sslContext, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);