summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2014-11-03 14:49:56 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2014-11-03 14:49:56 +0100
commit2cc6011e69ae9fd141dfcd3533f703096758b922 (patch)
tree26cb498e9d5fb1fd93b91d9da31029b392f5c763
parentea8dedc953919fa3f7a014ee1e0386f84ed326f1 (diff)
parentbc48bcdcb35785e8a51071e464e434fe1723585c (diff)
downloadlibgit2-2cc6011e69ae9fd141dfcd3533f703096758b922.tar.gz
Merge pull request #2684 from jacquesg/openssl-windows
Make the Visual Studio compiler happy
-rw-r--r--src/global.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/global.c b/src/global.c
index 1e6bf82f9..55b31196e 100644
--- a/src/global.c
+++ b/src/global.c
@@ -73,6 +73,13 @@ static void shutdown_ssl(void)
static void init_ssl(void)
{
#ifdef GIT_SSL
+ long ssl_opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
+
+ /* Older OpenSSL and MacOS OpenSSL doesn't have this */
+#ifdef SSL_OP_NO_COMPRESSION
+ ssl_opts |= SSL_OP_NO_COMPRESSION;
+#endif
+
SSL_load_error_strings();
OpenSSL_add_ssl_algorithms();
/*
@@ -82,13 +89,7 @@ static void init_ssl(void)
* to speak TLSv1 to perform the encryption itself.
*/
git__ssl_ctx = SSL_CTX_new(SSLv23_method());
- SSL_CTX_set_options(git__ssl_ctx,
- SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3
- /* Older OpenSSL and MacOS OpenSSL doesn't have this */
-# ifdef SSL_OP_NO_COMPRESSION
- | SSL_OP_NO_COMPRESSION
-# endif
- );
+ SSL_CTX_set_options(git__ssl_ctx, ssl_opts);
SSL_CTX_set_mode(git__ssl_ctx, SSL_MODE_AUTO_RETRY);
SSL_CTX_set_verify(git__ssl_ctx, SSL_VERIFY_NONE, NULL);
if (!SSL_CTX_set_default_verify_paths(git__ssl_ctx)) {