From 69c42078cc5512ba6ed9cbfd2644f501d59c0717 Mon Sep 17 00:00:00 2001
From: vmanoilov <vladinc@gmail.com>
Date: Mon, 21 Mar 2016 23:35:01 +0000
Subject: [PATCH] Update idevice.c

---
 src/idevice.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/idevice.c b/src/idevice.c
index b776e84..b5c4407 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -676,14 +676,16 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_enable_ssl(idevice_conne
 		debug_info("ERROR: Could not create SSL bio.");
 		return ret;
 	}
-	BIO_set_fd(ssl_bio, (int)(long)connection->data, BIO_NOCLOSE);
 
-	SSL_CTX *ssl_ctx = SSL_CTX_new(SSLv3_method());
-	if (ssl_ctx == NULL) {
-		debug_info("ERROR: Could not create SSL context.");
-		BIO_free(ssl_bio);
-		return ret;
-	}
+    BIO_set_fd(ssl_bio, (int)(long)connection->data, BIO_NOCLOSE);
+
+   SSL_CTX *ssl_ctx = SSL_CTX_new(SSLv23_method());
+    if (ssl_ctx == NULL) {
+        debug_info("ERROR: Could not create SSL context.");
+        BIO_free(ssl_bio);
+	return ret;
+    	
+    }
 
 	BIO* membp;
 	X509* rootCert = NULL;

