spdycat: add support for Server Name Indication (SNI).

Signed-off-by: Piotr Sikora <piotr.sikora@frickle.com>
This commit is contained in:
Piotr Sikora 2012-06-25 15:05:12 +00:00
parent 27dd0b7405
commit ebfc313a26
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}