Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ixwebsocket/IXSocketOpenSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ namespace ix
return false;
}

if (_tlsOptions.hasAdditionalOptions())
{
SSL_CTX_set_options(_ssl_context, _tlsOptions.additional_openssl_ctx_options);
}

return true;
}

Expand Down Expand Up @@ -598,7 +603,7 @@ namespace ix
SSL_CTX_set_mode(_ssl_context, SSL_MODE_ENABLE_PARTIAL_WRITE);
SSL_CTX_set_mode(_ssl_context, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
SSL_CTX_set_options(_ssl_context,
SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
SSL_OP_ALL | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | _tlsOptions.additional_openssl_ctx_options);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions ixwebsocket/IXSocketTLSOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ namespace ix
return true;
}

bool SocketTLSOptions::hasAdditionalOptions() const
{
return additional_openssl_ctx_options != 0;
}

bool SocketTLSOptions::hasCertAndKey() const
{
return !certFile.empty() && !keyFile.empty();
Expand Down
5 changes: 5 additions & 0 deletions ixwebsocket/IXSocketTLSOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ namespace ix
// whether to skip validating the peer's hostname against the certificate presented
bool disable_hostname_validation = false;

// additional OpenSSL CTX options to set when calling SSL_CTX_set_options during the handshake
uint64_t additional_openssl_ctx_options = 0;

bool hasAdditionalOptions() const;

bool hasCertAndKey() const;

bool isUsingSystemDefaults() const;
Expand Down