Skip to content

Enable tlsv2 when TLS is used #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2021
Merged
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
3 changes: 1 addition & 2 deletions src/internal/sio_client_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,9 @@ namespace sio
#if SIO_TLS
client_impl::context_ptr client_impl::on_tls_init(connection_hdl conn)
{
context_ptr ctx = context_ptr(new asio::ssl::context(asio::ssl::context::tlsv1));
context_ptr ctx = context_ptr(new asio::ssl::context(asio::ssl::context::tlsv12));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this forcing TLSv1.2 even if the server supports TLS v1.3?

Usually client libraries are permissive and connect using the most secure connection the server will allow, but there's a good argument for blacklisting ciphers and handshakes that are no longer considered secure to prevent downgrade attacks. Is it possible to choose "any TLS other than v1.0 or v1.1"? If not, I think just permitting all TLS handshakes supported by the server is probably better than hardcoding to v1.2 (eg: asio::ssl::context::tls).

asio::error_code ec;
ctx->set_options(asio::ssl::context::default_workarounds |
asio::ssl::context::no_sslv2 |
asio::ssl::context::single_dh_use,ec);
if(ec)
{
Expand Down