Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit f4b02df

Browse files
committed
1 parent 4cf2186 commit f4b02df

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

httplib.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6826,11 +6826,14 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
68266826

68276827
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
68286828
if (is_ssl()) {
6829-
char buf[1];
6830-
if (SSL_peek(socket_.ssl, buf, 1) == 0 &&
6831-
SSL_get_error(socket_.ssl, 0) == SSL_ERROR_ZERO_RETURN) {
6832-
error = Error::SSLPeerCouldBeClosed_;
6833-
return false;
6829+
auto is_proxy_enabled = !proxy_host_.empty() && proxy_port_ != -1;
6830+
if (!is_proxy_enabled) {
6831+
char buf[1];
6832+
if (SSL_peek(socket_.ssl, buf, 1) == 0 &&
6833+
SSL_get_error(socket_.ssl, 0) == SSL_ERROR_ZERO_RETURN) {
6834+
error = Error::SSLPeerCouldBeClosed_;
6835+
return false;
6836+
}
68346837
}
68356838
}
68366839
#endif

0 commit comments

Comments
 (0)