Skip to content

Commit cde2936

Browse files
committed
Merge branch 'ssl_error_reporting' of github.com:staticlibs/cpp-httplib into staticlibs-ssl_error_reporting
2 parents bae40fc + 23ff9a5 commit cde2936

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

httplib.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10923,7 +10923,11 @@ inline long SSLClient::get_openssl_verify_result() const {
1092310923
inline SSL_CTX *SSLClient::ssl_context() const { return ctx_; }
1092410924

1092510925
inline bool SSLClient::create_and_connect_socket(Socket &socket, Error &error) {
10926-
return is_valid() && ClientImpl::create_and_connect_socket(socket, error);
10926+
if (!is_valid()) {
10927+
error = Error::SSLConnection;
10928+
return false;
10929+
}
10930+
return ClientImpl::create_and_connect_socket(socket, error);
1092710931
}
1092810932

1092910933
// Assumes that socket_mutex_ is locked and that there are no requests in

0 commit comments

Comments
 (0)