@Override public Socket createSocket(String host, int port, InetAddress localAddress, int localPort, HttpConnectionParams params) throws IOException { if (params == null) { throw new IllegalArgumentException("Parameters may not be null"); } int timeout = params.getConnectionTimeout(); if (timeout == 0) { return createSocket(host, port, localAddress, localPort); } else { return ControllerThreadSocketFactory.createSocket( this, host, port, localAddress, localPort, timeout); } }
@Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { try { if (config != null && config.getUseGlobalSslContextParameters() != null && config.getUseGlobalSslContextParameters()) { SSLContextParameters globalSSLParams = context.getSSLContextParameters(); if (globalSSLParams != null) { ProtocolSocketFactory factory = new SSLContextParametersSecureProtocolSocketFactory(globalSSLParams, context); Protocol.registerProtocol("https", new Protocol( "https", factory, 443)); } } } catch (NoUniqueBeanDefinitionException e) { LOG.warn("Multiple instance of SSLContextParameters found, skipping configuration"); } catch (NoSuchBeanDefinitionException e) { LOG.debug("No instance of SSLContextParameters found"); } catch (BeansException e) { LOG.warn("Cannot create SSLContextParameters", e); } } }