diff options
Diffstat (limited to 'libfetch/common.c')
-rw-r--r-- | libfetch/common.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libfetch/common.c b/libfetch/common.c index e91b0c6..bcba889 100644 --- a/libfetch/common.c +++ b/libfetch/common.c @@ -499,15 +499,11 @@ static int fetch_ssl_setup_client_certificate(SSL_CTX *ctx, int verbose) int fetch_ssl(conn_t *conn, const struct url *URL, int verbose) { - /* Init the SSL library and context */ - if (!SSL_library_init()){ - fprintf(stderr, "SSL library init failed\n"); - return (-1); - } - - SSL_load_error_strings(); - +#if OPENSSL_VERSION_NUMBER < 0x10100000L conn->ssl_meth = SSLv23_client_method(); +#else + conn->ssl_meth = TLS_client_method(); +#endif conn->ssl_ctx = SSL_CTX_new(conn->ssl_meth); SSL_CTX_set_mode(conn->ssl_ctx, SSL_MODE_AUTO_RETRY); |