From 7c60ba9d1e5e58de57f127025bcf69f4baecd2b4 Mon Sep 17 00:00:00 2001 From: Chris Grahn Date: Thu, 2 Sep 2021 01:40:06 -0500 Subject: [PATCH] feat: support TLSv1.2 and newer (#321) Backported from master: https://github.com/socketio/socket.io-client-cpp/commit/82d39a90ef118500a0329d214eec331db983bd74 --- src/internal/sio_client_impl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/internal/sio_client_impl.cpp b/src/internal/sio_client_impl.cpp index 1f5e22e2..c7568874 100644 --- a/src/internal/sio_client_impl.cpp +++ b/src/internal/sio_client_impl.cpp @@ -577,10 +577,12 @@ 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::tlsv12)); + context_ptr ctx = context_ptr(new asio::ssl::context(asio::ssl::context::tls)); asio::error_code ec; ctx->set_options(asio::ssl::context::default_workarounds | - asio::ssl::context::single_dh_use,ec); + asio::ssl::context::no_tlsv1 | + asio::ssl::context::no_tlsv1_1 | + asio::ssl::context::single_dh_use,ec); if(ec) { cerr<<"Init tls failed,reason:"<< ec.message()<