aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-07 14:23:20 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:23:20 -0700
commit7b420ef2c0ce6393d0db2df5943405a982085e1c (patch)
tree8c23e42e520dfed353e51aa99b143c5baeea9eb4
parentMerge branch 'js/mingw-admins-are-special' (diff)
parentimap-send: explicitly verify the peer certificate (diff)
downloadgit-7b420ef2c0ce6393d0db2df5943405a982085e1c.tar.gz
git-7b420ef2c0ce6393d0db2df5943405a982085e1c.zip
Merge branch 'js/imap-send-peer-cert-verify'
* js/imap-send-peer-cert-verify: imap-send: explicitly verify the peer certificate
-rw-r--r--imap-send.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/imap-send.c b/imap-send.c
index 6c8f84e836..27dc033c7f 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -324,6 +324,8 @@ static int ssl_socket_connect(struct imap_socket *sock,
cert = SSL_get_peer_certificate(sock->ssl);
if (!cert)
return error("unable to get peer certificate.");
+ if (SSL_get_verify_result(sock->ssl) != X509_V_OK)
+ return error("unable to verify peer certificate");
if (verify_hostname(cert, cfg->host) < 0)
return -1;
}