From f8b6e469f16f44b6e6977819fe21acbcd66f09f9 Mon Sep 17 00:00:00 2001 From: Jianjun Zhu Date: Wed, 15 Jul 2015 14:37:52 +0800 Subject: [PATCH] Verify server's certificate. --- src/internal/sio_client_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internal/sio_client_impl.cpp b/src/internal/sio_client_impl.cpp index 9ce9b832..a360dca2 100644 --- a/src/internal/sio_client_impl.cpp +++ b/src/internal/sio_client_impl.cpp @@ -566,9 +566,11 @@ namespace sio ctx->set_options(boost::asio::ssl::context::default_workarounds | boost::asio::ssl::context::no_sslv2 | boost::asio::ssl::context::single_dh_use,ec); + ctx->set_verify_mode(boost::asio::ssl::verify_peer | + boost::asio::ssl::verify_fail_if_no_peer_cert, ec); if(ec) { - cerr<<"Init tls failed,reason:"<< ec.message()<