Commit 34f1ded9797838c6d1381c464fb2a6197dba211b

Etienne Samson 2017-12-13T00:19:41

stransport: provide error message on trust failures Fixes #4440

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/stransport_stream.c b/src/stransport_stream.c
index 50ed945..a43f544 100644
--- a/src/stransport_stream.c
+++ b/src/stransport_stream.c
@@ -81,8 +81,10 @@ static int stransport_connect(git_stream *stream)
 	}
 
 	if (sec_res == kSecTrustResultDeny || sec_res == kSecTrustResultRecoverableTrustFailure ||
-	    sec_res == kSecTrustResultFatalTrustFailure)
+	    sec_res == kSecTrustResultFatalTrustFailure) {
+		giterr_set(GITERR_SSL, "untrusted connection error");
 		return GIT_ECERTIFICATE;
+	}
 
 	return 0;