Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make the Visual Studio compiler happy #2684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
/*
Expand All @@ -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)) {
Expand Down