nghttpx: Check error from SSL_set_fd

This commit is contained in:
Tatsuhiro Tsujikawa 2014-06-12 23:39:58 +09:00
parent 25b58d5e22
commit 041cec2d97
1 changed files with 8 additions and 4 deletions

View File

@ -490,10 +490,14 @@ ClientHandler* accept_connection
<< ERR_error_string(ERR_get_error(), nullptr); << ERR_error_string(ERR_get_error(), nullptr);
return nullptr; return nullptr;
} }
SSL_set_fd(ssl, fd);
// To detect TLS renegotiation and deal with it, we have to use if(SSL_set_fd(ssl, fd) == 0) {
// filter-based OpenSSL bufferevent and set evbuffer callback by LOG(ERROR) << "SSL_set_fd() failed: "
// our own. << ERR_error_string(ERR_get_error(), nullptr);
SSL_free(ssl);
return nullptr;
}
bev = bufferevent_openssl_socket_new(evbase, fd, ssl, bev = bufferevent_openssl_socket_new(evbase, fd, ssl,
BUFFEREVENT_SSL_ACCEPTING, BUFFEREVENT_SSL_ACCEPTING,
BEV_OPT_DEFER_CALLBACKS); BEV_OPT_DEFER_CALLBACKS);