Commit caee0a6629d95669400bf6e64f64b81e5aebaa92

Etienne Samson 2018-08-29T01:57:22

openssl: set the error class to GITERR_SSL

diff --git a/src/streams/openssl.c b/src/streams/openssl.c
index 7fd810a..4b29d98 100644
--- a/src/streams/openssl.c
+++ b/src/streams/openssl.c
@@ -373,10 +373,10 @@ static int ssl_set_error(SSL *ssl, int error)
 	switch (err) {
 	case SSL_ERROR_WANT_CONNECT:
 	case SSL_ERROR_WANT_ACCEPT:
-		giterr_set(GITERR_NET, "SSL error: connection failure");
+		giterr_set(GITERR_SSL, "SSL error: connection failure");
 		break;
 	case SSL_ERROR_WANT_X509_LOOKUP:
-		giterr_set(GITERR_NET, "SSL error: x509 error");
+		giterr_set(GITERR_SSL, "SSL error: x509 error");
 		break;
 	case SSL_ERROR_SYSCALL:
 		e = ERR_get_error();
@@ -389,7 +389,7 @@ static int ssl_set_error(SSL *ssl, int error)
 			giterr_set(GITERR_OS, "SSL error: syscall failure");
 			break;
 		}
-		giterr_set(GITERR_NET, "SSL error: received early EOF");
+		giterr_set(GITERR_SSL, "SSL error: received early EOF");
 		return GIT_EEOF;
 		break;
 	case SSL_ERROR_SSL:
@@ -397,13 +397,13 @@ static int ssl_set_error(SSL *ssl, int error)
 		char errmsg[256];
 		e = ERR_get_error();
 		ERR_error_string_n(e, errmsg, sizeof(errmsg));
-		giterr_set(GITERR_NET, "SSL error: %s", errmsg);
+		giterr_set(GITERR_SSL, "SSL error: %s", errmsg);
 		break;
 	}
 	case SSL_ERROR_NONE:
 	case SSL_ERROR_ZERO_RETURN:
 	default:
-		giterr_set(GITERR_NET, "SSL error: unknown error");
+		giterr_set(GITERR_SSL, "SSL error: unknown error");
 		break;
 	}
 	return -1;