|
Boost Users : |
From: B Aleck (aleck099_at_[hidden])
Date: 2022-05-04 09:28:42
Thanks a lot. It's helpful
________________________________
·¢¼þÈË: Boost-users <boost-users-bounces_at_[hidden]> ´ú±í Richard Hodges via Boost-users <boost-users_at_[hidden]>
·¢ËÍʱ¼ä: 2022Äê5ÔÂ1ÈÕ 18:14
ÊÕ¼þÈË: Thomas Quarendon via Boost-users <boost-users_at_[hidden]>
³ËÍ: Richard Hodges <hodges.r_at_[hidden]>
Ö÷Ìâ: Re: [Boost-users] [Boost.Asio] [SSL] Can I set the host name before performing a handshake?
On Sun, 1 May 2022 at 09:11, B Aleck via Boost-users <boost-users_at_[hidden]<mailto:boost-users_at_[hidden]>> wrote:
In openssl you call SSL_set_tlsext_host_name to set that
Can I do that in boost?
Yes.
Example from one of my projects:
asio::awaitable< void >
connect(ssl::stream< tcp::socket > &stream, std::string const &host, std::string const &service)
{
using asio::use_awaitable;
co_await connect(stream.next_layer(), host, service);
// ==================== Set TLS host name here ====================
if (!SSL_set_tlsext_host_name(stream.native_handle(), host.c_str()))
throw sys::system_error(ERR_get_error(), asio::error::get_ssl_category());
// ================================================================
co_await stream.async_handshake(ssl::stream_base::client, use_awaitable);
}
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]<mailto:Boost-users_at_[hidden]>
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net