Commit 03994912 by Etienne Samson

openssl: only say we're connected if the connection succeeded

ssl_close uses this boolean to know if SSL_shutdown should be called.
It turns out OpenSSL auto-shutdowns on failure, so if the call to
SSL_connect fails, it will complain about "shutdown while in init",
trampling the original error.
parent caee0a66
......@@ -586,8 +586,6 @@ int openssl_connect(git_stream *stream)
if ((ret = git_stream_connect(st->io)) < 0)
return ret;
st->connected = true;
bio = BIO_new(git_stream_bio_method);
GITERR_CHECK_ALLOC(bio);
......@@ -602,6 +600,8 @@ int openssl_connect(git_stream *stream)
if ((ret = SSL_connect(st->ssl)) <= 0)
return ssl_set_error(st->ssl, ret);
st->connected = true;
return verify_server_cert(st->ssl, st->host);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment