if( StringUtils.isNullOrEmpty( sslConfig ) )
{
return enableSocket( ( SSLSocket )super.createSocket( host, port, localAddress, localPort, params ) );
}
EasySSLProtocolSocketFactory factory = factoryMap.get( sslConfig );
if( factory != null )
{
return enableSocket( ( SSLSocket )factory.createSocket( host, port, localAddress, localPort, params ) );
}
try
{
// try to create new factory for specified config
factory = new EasySSLProtocolSocketFactory();
int ix = sslConfig.lastIndexOf( ' ' );
String keyStore = sslConfig.substring( 0, ix );
String pwd = sslConfig.substring( ix + 1 );
factory.setKeyMaterial( new KeyMaterial( keyStore, pwd.toCharArray() ) );
factoryMap.put( sslConfig, factory );
return enableSocket( ( SSLSocket )factory.createSocket( host, port, localAddress, localPort, params ) );
}
catch( Exception gse )
{
SoapUI.logError( gse );
return enableSocket( ( SSLSocket )super.createSocket( host, port, localAddress, localPort, params ) );