Bug 1501589 - Backed out changeset fc3bc776f223 to make way for a better solution. a=backout
authorJorg K <jorgk@jorgk.com>
Wed, 24 Oct 2018 11:46:27 +0200
changeset 33552 97346356d25ce1dce070e8188f1a83749e2e8df7
parent 33551 fc3bc776f223d2244dd3a596b11460d826860d65
child 33553 3eb79f25d25b60d7b6e1b9e1638f795117621f66
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersbackout
bugs1501589
Bug 1501589 - Backed out changeset fc3bc776f223 to make way for a better solution. a=backout
ldap/xpcom/src/nsLDAPSecurityGlue.cpp
--- a/ldap/xpcom/src/nsLDAPSecurityGlue.cpp
+++ b/ldap/xpcom/src/nsLDAPSecurityGlue.cpp
@@ -6,17 +6,16 @@
 //
 #include "nsLDAPInternal.h"
 #include "nsCOMPtr.h"
 #include "nsIServiceManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsNetCID.h"
 #include "nsISocketProvider.h"
 #include "nsISSLSocketControl.h"
-#include "nsTLSSocketProvider.h"
 #include "nsString.h"
 #include "nsMemory.h"
 #include "plstr.h"
 #include "ldap.h"
 #include "ldappr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 
@@ -149,18 +148,22 @@ nsLDAPSSLConnect(const char *hostlist, i
     if (!socketClosure) {
         NS_WARNING("nsLDAPSSLConnect(): unable to allocate socket closure");
         goto close_socket_and_exit_with_error;
     }
     memset(socketClosure, 0, sizeof(nsLDAPSSLSocketClosure));
     socketClosure->sessionClosure = sessionClosure;
 
     // Add the NSPR layer for SSL provided by PSM to this socket.
-    tlsSocketProvider = new nsTLSSocketProvider();
-
+    //
+    tlsSocketProvider = do_GetService(NS_STARTTLSSOCKETPROVIDER_CONTRACTID, &rv);
+    if (NS_FAILED(rv)) {
+        NS_ERROR("nsLDAPSSLConnect(): unable to get socket provider service");
+        goto close_socket_and_exit_with_error;
+    }
     // XXXdmose: Note that hostlist can be a list of hosts (in the
     // current XPCOM SDK code, it will always be a list of IP
     // addresses).  Because of this, we need to use
     // sessionClosure->hostname which was passed in separately to tell
     // AddToSocket what to match the name in the certificate against.
     // What exactly happen will happen when this is used with some IP
     // address in the list other than the first one is not entirely
     // clear, and I suspect it may depend on the format of the name in