Commit 05d89e72 by Nikita Leshenko

streams: openssl: Handle error in SSL_CTX_new

SIGSEGV otherwise...
parent e6cdd17c
...@@ -219,6 +219,10 @@ int git_openssl_stream_global_init(void) ...@@ -219,6 +219,10 @@ int git_openssl_stream_global_init(void)
* to speak TLSv1 to perform the encryption itself. * to speak TLSv1 to perform the encryption itself.
*/ */
git__ssl_ctx = SSL_CTX_new(SSLv23_method()); git__ssl_ctx = SSL_CTX_new(SSLv23_method());
if (!git__ssl_ctx) {
return -1;
}
SSL_CTX_set_options(git__ssl_ctx, ssl_opts); SSL_CTX_set_options(git__ssl_ctx, ssl_opts);
SSL_CTX_set_mode(git__ssl_ctx, SSL_MODE_AUTO_RETRY); SSL_CTX_set_mode(git__ssl_ctx, SSL_MODE_AUTO_RETRY);
SSL_CTX_set_verify(git__ssl_ctx, SSL_VERIFY_NONE, NULL); SSL_CTX_set_verify(git__ssl_ctx, SSL_VERIFY_NONE, NULL);
......
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