From 3e4f257b9193e704fe790077b44f235e01101f52 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 3 May 2018 20:29:16 +0900 Subject: [PATCH] asio: Support client side SNI --- src/asio_client_session_tls_impl.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/asio_client_session_tls_impl.cc b/src/asio_client_session_tls_impl.cc index f1c21330..377886ca 100644 --- a/src/asio_client_session_tls_impl.cc +++ b/src/asio_client_session_tls_impl.cc @@ -38,6 +38,10 @@ session_tls_impl::session_tls_impl( // ssl::context::set_verify_mode(boost::asio::ssl::verify_peer) is // not used, which is what we want. socket_.set_verify_callback(boost::asio::ssl::rfc2818_verification(host)); + auto ssl = socket_.native_handle(); + if (!util::numeric_host(host.c_str())) { + SSL_set_tlsext_host_name(ssl, host.c_str()); + } } session_tls_impl::~session_tls_impl() {}