Skip to content

Commit

Permalink
SSLImplementation.getName() is not used so remove it.
Browse files Browse the repository at this point in the history
Further simplify the factory part of SSLImplementation
Remove OpenSSLImplementation.IMPLEMENTATION_NAME. Since it is the class name, use the class name.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1724028 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jan 11, 2016
1 parent 32b1fb4 commit ebc145f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
2 changes: 1 addition & 1 deletion java/org/apache/catalina/connector/Connector.java
Expand Up @@ -1008,7 +1008,7 @@ protected void initInternal() throws LifecycleException {
AbstractHttp11JsseProtocol<?> jsseProtocolHandler = (AbstractHttp11JsseProtocol<?>) protocolHandler;
if (jsseProtocolHandler.getSslImplementationName() == null) {
// OpenSSL is compatible with the JSSE configuration, so use it if APR is available
jsseProtocolHandler.setSslImplementationName(OpenSSLImplementation.IMPLEMENTATION_NAME);
jsseProtocolHandler.setSslImplementationName(OpenSSLImplementation.class.getName());
}
}

Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/tomcat/util/net/AbstractJsseEndpoint.java
Expand Up @@ -64,7 +64,7 @@ public void setSniParseLimit(int sniParseLimit) {

@Override
protected Type getSslConfigType() {
if (OpenSSLImplementation.IMPLEMENTATION_NAME.equals(sslImplementationName)) {
if (OpenSSLImplementation.class.getName().equals(sslImplementationName)) {
return SSLHostConfig.Type.EITHER;
} else {
return SSLHostConfig.Type.JSSE;
Expand Down
19 changes: 3 additions & 16 deletions java/org/apache/tomcat/util/net/SSLImplementation.java
Expand Up @@ -34,23 +34,12 @@ public abstract class SSLImplementation {
private static final Log logger = LogFactory.getLog(SSLImplementation.class);
private static final StringManager sm = StringManager.getManager(SSLImplementation.class);

/**
* Obtain an instance (not a singleton) of the default implementation.
* Currently, this is the standard JSSE implementation that ships as part of
* the JRE. Tomcat also provides an OpenSSL based implementation.
*
* @return The default implementation
*/
public static SSLImplementation getInstance() {
return new JSSEImplementation();
}


/**
* Obtain an instance (not a singleton) of the implementation with the given
* class name.
*
* @param className The class name of the required implementation
* @param className The class name of the required implementation or null to
* use the default (currently {@link JSSEImplementation}.
*
* @return An instance of the required implementation
*
Expand All @@ -60,7 +49,7 @@ public static SSLImplementation getInstance() {
public static SSLImplementation getInstance(String className)
throws ClassNotFoundException {
if (className == null)
return getInstance();
return new JSSEImplementation();

try {
Class<?> clazz = Class.forName(className);
Expand All @@ -75,8 +64,6 @@ public static SSLImplementation getInstance(String className)
}


public abstract String getImplementationName();

public abstract SSLSupport getSSLSupport(SSLSession session);

public abstract SSLUtil getSSLUtil(SSLHostConfig sslHostConfig,
Expand Down
5 changes: 0 additions & 5 deletions java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java
Expand Up @@ -40,11 +40,6 @@ public JSSEImplementation() {
JSSESupport.init();
}

@Override
public String getImplementationName(){
return "JSSE";
}

@Override
public SSLSupport getSSLSupport(SSLSession session) {
return new JSSESupport(session);
Expand Down
Expand Up @@ -27,13 +27,6 @@

public class OpenSSLImplementation extends SSLImplementation {

public static final String IMPLEMENTATION_NAME = "org.apache.tomcat.util.net.openssl.OpenSSLImplementation";

@Override
public String getImplementationName() {
return "OpenSSl";
}

@Override
public SSLSupport getSSLSupport(SSLSession session) {
return new JSSESupport(session);
Expand Down

0 comments on commit ebc145f

Please sign in to comment.