stransport: provide error message on trust failures Fixes #4440
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;