Skip to content

Commit

Permalink
Merge pull request #207 from ioBanker/patch-1
Browse files Browse the repository at this point in the history
Websocket to support TLSv1.2
  • Loading branch information
abitmore authored Sep 13, 2020
2 parents 9e14f23 + ed411d2 commit 24e41f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/network/http/websocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,13 @@ namespace fc { namespace http {
{
_server.set_tls_init_handler( [this,server_pem,ssl_password]( websocketpp::connection_hdl hdl ) {
context_ptr ctx = websocketpp::lib::make_shared<boost::asio::ssl::context>(
boost::asio::ssl::context::tlsv1 );
boost::asio::ssl::context::tlsv12 );
try {
ctx->set_options( boost::asio::ssl::context::default_workarounds |
boost::asio::ssl::context::no_sslv2 |
boost::asio::ssl::context::no_sslv3 |
boost::asio::ssl::context::no_tlsv1 |
boost::asio::ssl::context::no_tlsv1_1 |
boost::asio::ssl::context::single_dh_use );
ctx->set_password_callback(
[ssl_password](std::size_t max_length, boost::asio::ssl::context::password_purpose){
Expand Down Expand Up @@ -582,11 +584,13 @@ namespace fc { namespace http {

_client.set_tls_init_handler( [this,ca_filename_copy](websocketpp::connection_hdl) {
context_ptr ctx = websocketpp::lib::make_shared<boost::asio::ssl::context>(
boost::asio::ssl::context::tlsv1);
boost::asio::ssl::context::tlsv12);
try {
ctx->set_options( boost::asio::ssl::context::default_workarounds |
boost::asio::ssl::context::no_sslv2 |
boost::asio::ssl::context::no_sslv3 |
boost::asio::ssl::context::no_tlsv1 |
boost::asio::ssl::context::no_tlsv1_1 |
boost::asio::ssl::context::single_dh_use );

setup_peer_verify( ctx, ca_filename_copy );
Expand Down

0 comments on commit 24e41f7

Please sign in to comment.