diff options
-rw-r--r-- | src/netops.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/netops.c b/src/netops.c index 1e1832112..24092c17f 100644 --- a/src/netops.c +++ b/src/netops.c @@ -287,6 +287,10 @@ static int verify_server_cert(gitno_ssl *ssl, const char *host) cert = SSL_get_peer_certificate(ssl->ssl); + if (!cert) { + giterr_set(GITERR_SSL, "the server did not provide a certificate"); + return -1; + } /* Check the alternative names */ alts = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); |