public static SSLImplementation getInstance() throws ClassNotFoundException { for(int i=0;i<implementations.length;i++){ try { SSLImplementation impl= getInstance(implementations[i]); return impl; } catch (Exception e) { if(logger.isTraceEnabled()) logger.trace("Error creating " + implementations[i],e); } } // If we can't instantiate any of these throw new ClassNotFoundException("Can't find any SSL implementation"); }
@Override public boolean isAlpnSupported() { // ALPN requires TLS so if TLS is not enabled, ALPN cannot be supported if (!isSSLEnabled()) { return false; } // Depends on the SSLImplementation. SSLImplementation sslImplementation; try { sslImplementation = SSLImplementation.getInstance(getSslImplementationName()); } catch (ClassNotFoundException e) { // Ignore the exception. It will be logged when trying to start the // end point. return false; } return sslImplementation.isAlpnSupported(); }
@Override protected void initSsl(SocketWrapper<Socket> socket, Processor<Socket> processor) { if (proto.isSSLEnabled() && (proto.sslImplementation != null)) { processor.setSslSupport( proto.sslImplementation.getSSLSupport( socket.getSocket())); } else { processor.setSslSupport(null); } }
if (isSSLEnabled()) { sslImplementation = SSLImplementation.getInstance(sslImplementationName); socketFactory = sslImplementation.getServerSocketFactory(); endpoint.setServerSocketFactory(socketFactory); } else if (socketFactoryName != null) {
if (isSSLEnabled()) { serverSocketFactory = handler.getSslImplementation().getServerSocketFactory(this); } else { serverSocketFactory = new DefaultServerSocketFactory(this);
SSLUtil sslUtil = handler.getSslImplementation().getSSLUtil(this);
@Override protected void initSsl(SocketWrapper<Socket> socket, Processor<Socket> processor) { if (proto.isSSLEnabled() && (proto.sslImplementation != null)) { processor.setSslSupport( proto.sslImplementation.getSSLSupport( socket.getSocket())); } else { processor.setSslSupport(null); } }
if (isSSLEnabled()) { sslImplementation = SSLImplementation.getInstance(sslImplementationName); socketFactory = sslImplementation.getServerSocketFactory(); endpoint.setServerSocketFactory(socketFactory); } else if (socketFactoryName != null) {
if (isSSLEnabled()) { serverSocketFactory = handler.getSslImplementation().getServerSocketFactory(this); } else { serverSocketFactory = new DefaultServerSocketFactory(this);
SSLUtil sslUtil = handler.getSslImplementation().getSSLUtil(this);
@Override public void init() throws Exception { // SSL implementation needs to be in place before end point is // initialized sslImplementation = SSLImplementation.getInstance(sslImplementationName); super.init(); } }
@Override protected void initSsl(SocketWrapper<Socket> socket, Http11Processor processor) { if (proto.isSSLEnabled() && (proto.sslImplementation != null)) { processor.setSSLSupport( proto.sslImplementation.getSSLSupport( socket.getSocket())); } else { processor.setSSLSupport(null); } }
SSLImplementation sslHelper = SSLImplementation.getInstance(); ServerSocketFactory serverSF = sslHelper.getServerSocketFactory(); serverSF.setAttribute("keystoreType","JKS"); serverSF.setAttribute("keystore",
if (isSSLEnabled()) { serverSocketFactory = handler.getSslImplementation().getServerSocketFactory(this); } else { serverSocketFactory = new DefaultServerSocketFactory(this);
SSLUtil sslUtil = handler.getSslImplementation().getSSLUtil(this);
@Override public void init() throws Exception { // SSL implementation needs to be in place before end point is // initialized sslImplementation = SSLImplementation.getInstance(sslImplementationName); super.init(); } }
/** * {@inheritDoc} * @param clientCertProvider Ignored for this implementation */ @Override public SSLSupport getSslSupport(String clientCertProvider) { if (getSocket() instanceof SecureNioChannel) { SecureNioChannel ch = (SecureNioChannel) getSocket(); SSLSession session = ch.getSslEngine().getSession(); return ((NioEndpoint) getEndpoint()).getSslImplementation().getSSLSupport(session); } else { return null; } }
if (isSSLEnabled()) { serverSocketFactory = handler.getSslImplementation().getServerSocketFactory(this); } else { serverSocketFactory = new DefaultServerSocketFactory(this);
@Override protected void createSSLContext(SSLHostConfig sslHostConfig) throws IllegalArgumentException { boolean firstCertificate = true; for (SSLHostConfigCertificate certificate : sslHostConfig.getCertificates(true)) { SSLUtil sslUtil = sslImplementation.getSSLUtil(certificate); if (firstCertificate) { firstCertificate = false; sslHostConfig.setEnabledProtocols(sslUtil.getEnabledProtocols()); sslHostConfig.setEnabledCiphers(sslUtil.getEnabledCiphers()); } SSLContext sslContext; try { sslContext = sslUtil.createSSLContext(negotiableProtocols); sslContext.init(sslUtil.getKeyManagers(), sslUtil.getTrustManagers(), null); } catch (Exception e) { throw new IllegalArgumentException(e.getMessage(), e); } SSLSessionContext sessionContext = sslContext.getServerSessionContext(); if (sessionContext != null) { sslUtil.configureSessionContext(sessionContext); } certificate.setSslContext(sslContext); } }
@Override public void init() throws Exception { // SSL implementation needs to be in place before end point is // initialized sslImplementation = SSLImplementation.getInstance(sslImplemenationName); super.init(); } }