Juan Lang : wininet: Move initialization of SSL_CTX to library initialization time.

Alexandre Julliard julliard at winehq.org
Thu Oct 1 09:48:19 CDT 2009


Module: wine
Branch: master
Commit: 5c6f47f7a764b632d9ef08490c48fe425be2f3f1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5c6f47f7a764b632d9ef08490c48fe425be2f3f1

Author: Juan Lang <juan.lang at gmail.com>
Date:   Tue Sep 29 11:05:11 2009 -0700

wininet: Move initialization of SSL_CTX to library initialization time.

---

 dlls/wininet/netconnection.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c
index b5ca18a..2e97017 100644
--- a/dlls/wininet/netconnection.c
+++ b/dlls/wininet/netconnection.c
@@ -209,6 +209,14 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
 	pBIO_new_fp(stderr, BIO_NOCLOSE); /* FIXME: should use winedebug stuff */
 
 	meth = pSSLv23_method();
+        ctx = pSSL_CTX_new(meth);
+        if (!pSSL_CTX_set_default_verify_paths(ctx))
+        {
+            ERR("SSL_CTX_set_default_verify_paths failed: %s\n",
+                pERR_error_string(pERR_get_error(), 0));
+            INTERNET_SetLastError(ERROR_OUTOFMEMORY);
+            return FALSE;
+        }
 #else
 	FIXME("can't use SSL, not compiled in.\n");
         INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR);
@@ -371,14 +379,6 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname)
         return FALSE;
     }
 
-    ctx = pSSL_CTX_new(meth);
-    if (!pSSL_CTX_set_default_verify_paths(ctx))
-    {
-        ERR("SSL_CTX_set_default_verify_paths failed: %s\n",
-            pERR_error_string(pERR_get_error(), 0));
-        INTERNET_SetLastError(ERROR_OUTOFMEMORY);
-        return FALSE;
-    }
     connection->ssl_s = pSSL_new(ctx);
     if (!connection->ssl_s)
     {




More information about the wine-cvs mailing list