@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); } } }