Forum Discussion
13 years ago
I had the same problem. It happens because soapUI attempts to validate the certificate when using a proxy (as opposed to not using a proxy where no validation is performed). It happens the createLayeredSocket() method calls createSocket() from a default SSLSocketFactory instead of using the SoapUISSLSocketFactory. As a side note the methods used are deprecated in version 4.1.1 of Apache's HTTP Client in favor of http://hc.apache.org/httpcomponents-cli ... pParams%29:
http://hc.apache.org/httpcomponents-cli ... boolean%29
http://hc.apache.org/httpcomponents-cli ... boolean%29
The following patch fixes the problem for me.
git diff
diff --git a/src/java/com/eviware/soapui/impl/wsdl/support/http/SoapUISSLSocketFactory.java b/src/java/com/eviware/soapui/impl/wsdl/support/http/SoapUISSLSocketFactory.java
index d21adb1..16c437e 100644
--- a/src/java/com/eviware/soapui/impl/wsdl/support/http/SoapUISSLSocketFactory.java
+++ b/src/java/com/eviware/soapui/impl/wsdl/support/http/SoapUISSLSocketFactory.java
@@ -265,13 +265,10 @@ public class SoapUISSLSocketFactory extends SSLSocketFactory
public Socket createLayeredSocket( final Socket socket, final String host, final int port, final boolean autoClose )
throws IOException, UnknownHostException
{
- SSLSocket sslSocket = ( SSLSocket )getSocketFactory().createSocket( socket, host, port, autoClose );
+
+ SSLSocket sslSocket = ( SSLSocket )sslContext.getSocketFactory().createSocket( socket, host, port, autoClose );
+
sslSocket = enableSocket( sslSocket );
-// if( getHostnameVerifier() != null )
-// {
-// getHostnameVerifier().verify( host, sslSocket );
-// }
- // verifyHostName() didn't blowup - good!
return sslSocket;
}
}
http://hc.apache.org/httpcomponents-cli ... boolean%29
http://hc.apache.org/httpcomponents-cli ... boolean%29
The following patch fixes the problem for me.
git diff
diff --git a/src/java/com/eviware/soapui/impl/wsdl/support/http/SoapUISSLSocketFactory.java b/src/java/com/eviware/soapui/impl/wsdl/support/http/SoapUISSLSocketFactory.java
index d21adb1..16c437e 100644
--- a/src/java/com/eviware/soapui/impl/wsdl/support/http/SoapUISSLSocketFactory.java
+++ b/src/java/com/eviware/soapui/impl/wsdl/support/http/SoapUISSLSocketFactory.java
@@ -265,13 +265,10 @@ public class SoapUISSLSocketFactory extends SSLSocketFactory
public Socket createLayeredSocket( final Socket socket, final String host, final int port, final boolean autoClose )
throws IOException, UnknownHostException
{
- SSLSocket sslSocket = ( SSLSocket )getSocketFactory().createSocket( socket, host, port, autoClose );
+
+ SSLSocket sslSocket = ( SSLSocket )sslContext.getSocketFactory().createSocket( socket, host, port, autoClose );
+
sslSocket = enableSocket( sslSocket );
-// if( getHostnameVerifier() != null )
-// {
-// getHostnameVerifier().verify( host, sslSocket );
-// }
- // verifyHostName() didn't blowup - good!
return sslSocket;
}
}