Commit 9c8dbc889320277f9b678704cca86eea769c73e1

Michael Schubert 2012-12-17T19:18:34

netops: properly handle GITNO_CONNECT_SSL_NO_CHECK_CERT Don't return an error just because GITNO_CONNECT_SSL_NO_CHECK_CERT is set.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/netops.c b/src/netops.c
index ccf03be..e2ec0d3 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -409,10 +409,10 @@ static int ssl_setup(gitno_socket *socket, const char *host, int flags)
 	if ((ret = SSL_connect(socket->ssl.ssl)) <= 0)
 		return ssl_set_error(&socket->ssl, ret);
 
-	if ((GITNO_CONNECT_SSL_NO_CHECK_CERT & flags) || verify_server_cert(&socket->ssl, host) < 0)
-		return -1;
+	if (GITNO_CONNECT_SSL_NO_CHECK_CERT & flags)
+		return 0;
 
-	return 0;
+	return verify_server_cert(&socket->ssl, host);
 }
 #endif