Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 22fbb26

Browse files
committed
netops: return GIT_ECERTIFICATE when it fails the basic tests
When we first ask OpenSSL to verify the certfiicate itself (rather than the HTTPS specifics), we should also return GIT_ECERTIFICATE. Otherwise, the caller would consider this as a failed operation rather than a failed validation and not call the user's own validation.
1 parent 264d74f commit 22fbb26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/netops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int verify_server_cert(gitno_ssl *ssl, const char *host)
276276

277277
if (SSL_get_verify_result(ssl->ssl) != X509_V_OK) {
278278
giterr_set(GITERR_SSL, "The SSL certificate is invalid");
279-
return -1;
279+
return GIT_ECERTIFICATE;
280280
}
281281

282282
/* Try to parse the host as an IP address to see if it is */

0 commit comments

Comments
 (0)