openssl: set the error class to GITERR_SSL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
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;