From ebfc313a265500ccf57f710257acc444dc8d696a Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Mon, 25 Jun 2012 15:05:12 +0000 Subject: [PATCH] spdycat: add support for Server Name Indication (SNI). Signed-off-by: Piotr Sikora --- examples/spdycat.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/spdycat.cc b/examples/spdycat.cc index 7a21ac9..075a128 100644 --- a/examples/spdycat.cc +++ b/examples/spdycat.cc @@ -482,6 +482,10 @@ int communicate(const std::string& host, uint16_t port, std::cerr << ERR_error_string(ERR_get_error(), 0) << std::endl; return -1; } + if (!SSL_set_tlsext_host_name(ssl, host.c_str())) { + std::cerr << ERR_error_string(ERR_get_error(), 0) << std::endl; + return -1; + } if(ssl_handshake(ssl, fd) == -1) { return -1; }