]> git.proxmox.com Git - libgit2.git/commitdiff
winhttp: only do certificate check for SSL
authorCarlos Martín Nieto <cmn@dwim.me>
Sat, 30 Aug 2014 11:12:33 +0000 (13:12 +0200)
committerCarlos Martín Nieto <cmn@dwim.me>
Tue, 16 Sep 2014 15:01:31 +0000 (17:01 +0200)
If we're not using SSL, don't call the user's certificate check callback.

src/transports/winhttp.c

index 3ddf49d6041cabce63bcc23ce9e5bd82d772648d..e6bd1c9e1f6dc518d591259e66ee9cda0037a80e 100644 (file)
@@ -212,7 +212,7 @@ static int certificate_check(winhttp_stream *s, int valid)
        PCERT_CONTEXT cert_ctx;
        DWORD cert_ctx_size = sizeof(cert_ctx);
 
-       if (t->owner->certificate_check_cb == NULL)
+       if (t->owner->certificate_check_cb == NULL || !t->connection_data.use_ssl)
                return 0;
 
        if (!WinHttpQueryOption(s->request, WINHTTP_OPTION_SERVER_CERT_CONTEXT, &cert_ctx, &cert_ctx_size)) {