Commit 5c3c86b06e84ac70735b2629209de2dcc0e09034

Vicent Martí 2012-12-19T13:43:50

Merge pull request #1150 from schu/fix-netops-ssl netops: on SSL teardown only send shutdown alert

diff --git a/src/netops.c b/src/netops.c
index ccf03be..d3441e0 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -198,10 +198,7 @@ static int gitno_ssl_teardown(gitno_ssl *ssl)
 {
 	int ret;
 
-	do {
-		ret = SSL_shutdown(ssl->ssl);
-	} while (ret == 0);
-
+	ret = SSL_shutdown(ssl->ssl);
 	if (ret < 0)
 		ret = ssl_set_error(ssl, ret);
 	else
@@ -409,10 +406,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