Skip to content
Permalink
Browse files

http: check certificate validity before clobbering the error variable

  • Loading branch information...
tiennou authored and ethomson committed Dec 21, 2016
1 parent 75db289 commit 9a64e62f0f20c9cf9b2e1609f037060eb2d8eb22
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/transports/http.c
@@ -624,13 +624,12 @@ static int http_connect(http_subtransport *t)
if ((!error || error == GIT_ECERTIFICATE) && t->owner->certificate_check_cb != NULL &&
git_stream_is_encrypted(t->io)) {
git_cert *cert;
int is_valid;
int is_valid = (error == GIT_OK);

if ((error = git_stream_certificate(&cert, t->io)) < 0)
return error;

giterr_clear();
is_valid = error != GIT_ECERTIFICATE;
error = t->owner->certificate_check_cb(cert, is_valid, t->connection_data.host, t->owner->message_cb_payload);

if (error < 0) {

0 comments on commit 9a64e62

Please sign in to comment.
You can’t perform that action at this time.