Index: impl/src/main/java/org/glassfish/web/embed/impl/WebContainerImpl.java =================================================================== --- impl/src/main/java/org/glassfish/web/embed/impl/WebContainerImpl.java (revision 52106) +++ impl/src/main/java/org/glassfish/web/embed/impl/WebContainerImpl.java (working copy) @@ -297,7 +297,6 @@ if (webListener instanceof HttpsListener) { HttpsListener listener = (HttpsListener) webListener; - newSsl.setCertNickname("s1as"); SslConfig sslConfig = listener.getSslConfig(); if (sslConfig == null) { return; @@ -312,6 +311,9 @@ if (sslConfig.getTrustStore() != null) { newSsl.setTrustStore(sslConfig.getTrustStore()); } + if (sslConfig.getTrustPassword() != null) { + newSsl.setTrustStorePassword(new String(sslConfig.getTrustPassword())); + } if (sslConfig.getAlgorithms() != null) { for (SslType sslType : sslConfig.getAlgorithms()) { @@ -329,10 +331,10 @@ if (sslConfig.getHandshakeTimeout() > 0) { newSsl.setSSLInactivityTimeout(sslConfig.getHandshakeTimeout()); } + if (sslConfig.getCertNickname() != null) { + newSsl.setCertNickname(sslConfig.getCertNickname()); + } - newSsl.setCertNickname("s1as"); - newSsl.setClassname("com.sun.enterprise.security.ssl.GlassfishSSLImpl"); - } else { log.severe("HttpsListener required for https protocol"); } Index: api/src/main/java/org/glassfish/embeddable/web/config/SslConfig.java =================================================================== --- api/src/main/java/org/glassfish/embeddable/web/config/SslConfig.java (revision 52106) +++ api/src/main/java/org/glassfish/embeddable/web/config/SslConfig.java (working copy) @@ -53,6 +53,9 @@ private String keyStore; private String trustStore; private char[] keyPassword; + private char[] trustPassword; + private String certNickname; + private int timeoutMilliSeconds; private Set algorithms; @@ -95,6 +98,15 @@ } /** + * Sets the password of the truststore file + * + * @param trustPassword The password of the truststore file + */ + public void setTrustPassword(char[] trustPassword) { + this.trustPassword = trustPassword; + } + + /** * Sets the timeout within which there must be activity from the client * * @param timeoutMilliSeconds The timeout in milliseconds @@ -140,6 +152,15 @@ } /** + * Gets the password of the truststore file + * + * @return the password of the truststore file + */ + public char[] getTrustPassword() { + return this.trustPassword; + } + + /** * Gets the timeout within which there must be activity from the client * * @return the timeout in milliseconds @@ -156,4 +177,22 @@ public Set getAlgorithms() { return this.algorithms; } + + /** + * Gets the nickname of the server certificate in the certificate database + * + * @return the certNickname + */ + public String getCertNickname() { + return this.certNickname; + } + + /** + * Sets the certNickname + * + */ + public void setCertNickname(String value) { + this.certNickname = value; + } + }