Skip to content

Commit

Permalink
Disable TLS renegotiation if supported
Browse files Browse the repository at this point in the history
The API doesn't need it and a customer's security scanner
is afraid of a potential DoS attack vector.
  • Loading branch information
Al2Klimov committed Oct 24, 2023
1 parent 76b460c commit 40278e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/base/tlsutility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 >= 0x10101000L
flags |= SSL_OP_NO_RENEGOTIATION;
#endif /* OPENSSL_VERSION_NUMBER >= 0x10101000L */

SSL_CTX_set_options(sslContext, flags);

SSL_CTX_set_mode(sslContext, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
Expand Down

0 comments on commit 40278e9

Please sign in to comment.