tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject [2/2] tomee git commit: TOMEE-2196 fix keyStoreFile property
Date Mon, 18 Jun 2018 15:12:35 GMT
TOMEE-2196 fix keyStoreFile property

txs to gerdogdu for the patch!


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/c381de03
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/c381de03
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/c381de03

Branch: refs/heads/master
Commit: c381de03bde90e7013efff159e6ebc525c1b20c4
Parents: 886decc
Author: Mark Struberg <struberg@apache.org>
Authored: Mon Jun 18 17:11:39 2018 +0200
Committer: Mark Struberg <struberg@apache.org>
Committed: Mon Jun 18 17:11:39 2018 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/tomee/embedded/Container.java   |  2 +-
 .../java/org/apache/tomee/embedded/SslTomEETest.java     | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/c381de03/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
index cb745a3..5458ba7 100644
--- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
+++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
@@ -629,7 +629,7 @@ public class Container implements AutoCloseable {
             httpsConnector.setProperty("sslProtocol", configuration.getSslProtocol());
 
             if (configuration.getKeystoreFile() != null) {
-                httpsConnector.setAttribute("", configuration.getKeystoreFile());
+                httpsConnector.setAttribute("keystoreFile", configuration.getKeystoreFile());
             }
             if (configuration.getKeystorePass() != null) {
                 httpsConnector.setAttribute("keystorePass", configuration.getKeystorePass());

http://git-wip-us.apache.org/repos/asf/tomee/blob/c381de03/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/SslTomEETest.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/SslTomEETest.java
b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/SslTomEETest.java
index 3f5e711..ae98087 100644
--- a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/SslTomEETest.java
+++ b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/SslTomEETest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.tomee.embedded;
 
+import org.apache.catalina.connector.Connector;
 import org.apache.openejb.loader.Files;
 import org.bouncycastle.asn1.x500.X500Name;
 import org.bouncycastle.cert.X509CertificateHolder;
@@ -43,6 +44,7 @@ import java.util.concurrent.TimeUnit;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 
 public class SslTomEETest {
     @Test
@@ -104,6 +106,15 @@ public class SslTomEETest {
         final Container container = new Container();
         container.setup(configuration);
         container.start();
+        Connector[] connectors = container.getTomcat().getService().findConnectors();
+        for(Connector conn : connectors) {
+        	if(conn.getPort() == 8443) {
+        		Object propertyObject = conn.getProperty("keystoreFile");
+                assertNotNull(propertyObject);
+                assertEquals(keystore.getAbsolutePath(), propertyObject.toString());
+        	}
+        }
+
         try {
             assertEquals(8443, ManagementFactory.getPlatformMBeanServer().getAttribute(new
ObjectName("Tomcat:type=ProtocolHandler,port=8443"), "port"));
         } finally {


Mime
View raw message