From e9eef502cf7a1d71ec1fe2a71a56a1ea48a0ec92 Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 8 Dec 2010 14:09:26 +0000 Subject: [PATCH] Align BIO+JSSE with NIO+JSSE git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1043425 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/coyote/http11/Http11Protocol.java | 53 +---------------------- 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/java/org/apache/coyote/http11/Http11Protocol.java b/java/org/apache/coyote/http11/Http11Protocol.java index b20532985..ef99f06c2 100644 --- a/java/org/apache/coyote/http11/Http11Protocol.java +++ b/java/org/apache/coyote/http11/Http11Protocol.java @@ -20,7 +20,6 @@ package org.apache.coyote.http11; import java.net.Socket; import java.security.AccessController; import java.security.PrivilegedAction; -import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; @@ -36,10 +35,9 @@ import org.apache.tomcat.util.modeler.Registry; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.JIoEndpoint; import org.apache.tomcat.util.net.JIoEndpoint.Handler; -import org.apache.tomcat.util.net.SSLImplementation; -import org.apache.tomcat.util.net.ServerSocketFactory; import org.apache.tomcat.util.net.SocketStatus; import org.apache.tomcat.util.net.SocketWrapper; +import org.apache.tomcat.util.net.jsse.JSSEImplementation; /** @@ -85,43 +83,15 @@ public class Http11Protocol extends AbstractHttp11JsseProtocol { protected Http11ConnectionHandler cHandler; - protected ServerSocketFactory socketFactory = null; - - // ----------------------------------------- ProtocolHandler Implementation @Override public void init() throws Exception { endpoint.setName(getName()); - // Verify the validity of the configured socket factory - try { - if (isSSLEnabled()) { - sslImplementation = - SSLImplementation.getInstance(sslImplementationName); - socketFactory = sslImplementation.getServerSocketFactory(); - ((JIoEndpoint)endpoint).setServerSocketFactory(socketFactory); - } else if (socketFactoryName != null) { - socketFactory = (ServerSocketFactory) Class.forName(socketFactoryName).newInstance(); - ((JIoEndpoint)endpoint).setServerSocketFactory(socketFactory); - } - } catch (Exception ex) { - log.error(sm.getString("http11protocol.socketfactory.initerror"), - ex); - throw ex; - } - - if (socketFactory!=null) { - Iterator attE = attributes.keySet().iterator(); - while( attE.hasNext() ) { - String key = attE.next(); - Object v=attributes.get(key); - socketFactory.setAttribute(key, v); - } - } - try { endpoint.init(); + sslImplementation = new JSSEImplementation(); } catch (Exception ex) { log.error(sm.getString("http11protocol.endpoint.initerror"), ex); throw ex; @@ -159,25 +129,6 @@ public class Http11Protocol extends AbstractHttp11JsseProtocol { } - // ------------------------------------------------------------- Properties - - /** - * Name of the socket factory. - */ - protected String socketFactoryName = null; - public String getSocketFactory() { return socketFactoryName; } - public void setSocketFactory(String valueS) { socketFactoryName = valueS; } - - /** - * Name of the SSL implementation. - */ - protected String sslImplementationName=null; - public String getSSLImplementation() { return sslImplementationName; } - public void setSSLImplementation( String valueS) { - sslImplementationName = valueS; - setSecure(true); - } - // ----------------------------------- Http11ConnectionHandler Inner Class protected static class Http11ConnectionHandler implements Handler { -- 2.11.0