1
0
mirror of synced 2025-04-20 11:47:43 +03:00
This commit is contained in:
yhirose 2023-03-25 21:13:07 -04:00
parent 4cf218643e
commit f4b02dfdc1

View File

@ -6826,11 +6826,14 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT #ifdef CPPHTTPLIB_OPENSSL_SUPPORT
if (is_ssl()) { if (is_ssl()) {
char buf[1]; auto is_proxy_enabled = !proxy_host_.empty() && proxy_port_ != -1;
if (SSL_peek(socket_.ssl, buf, 1) == 0 && if (!is_proxy_enabled) {
SSL_get_error(socket_.ssl, 0) == SSL_ERROR_ZERO_RETURN) { char buf[1];
error = Error::SSLPeerCouldBeClosed_; if (SSL_peek(socket_.ssl, buf, 1) == 0 &&
return false; SSL_get_error(socket_.ssl, 0) == SSL_ERROR_ZERO_RETURN) {
error = Error::SSLPeerCouldBeClosed_;
return false;
}
} }
} }
#endif #endif