openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1819341 - in /openwebbeans/meecrowave/trunk: integration-tests/ integration-tests/ssl/ integration-tests/ssl/src/ integration-tests/ssl/src/main/ integration-tests/ssl/src/main/java/ integration-tests/ssl/src/main/java/org/ integration-tes...
Date Wed, 27 Dec 2017 15:36:53 GMT
Author: rmannibucau
Date: Wed Dec 27 15:36:52 2017
New Revision: 1819341

URL: http://svn.apache.org/viewvc?rev=1819341&view=rev
Log:
MEECROWAVE-87 awesome patch from Ravisankar Challa to better handle SSL configuration after last tomcat upgrades, thanks a lot

Added:
    openwebbeans/meecrowave/trunk/integration-tests/ssl/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/pom.xml
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/meecrowave/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/meecrowave/tests/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/meecrowave/tests/ssl/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/meecrowave/tests/ssl/HelloWorld.java
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/ca-chain.cert.pem
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.cert.pem
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.key.pem
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_first_host.jks   (with props)
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_second_host.jks   (with props)
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_trust.jks   (with props)
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslDefaultConfigurationTest.java
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslHostConfigPropertiesTest.java
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TestSetup.java
    openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TlsVirtualHostPropertiesTest.java
Modified:
    openwebbeans/meecrowave/trunk/integration-tests/pom.xml
    openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
    openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java
    openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java
    openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java

Modified: openwebbeans/meecrowave/trunk/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/pom.xml?rev=1819341&r1=1819340&r2=1819341&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/pom.xml (original)
+++ openwebbeans/meecrowave/trunk/integration-tests/pom.xml Wed Dec 27 15:36:52 2017
@@ -36,5 +36,6 @@
     <module>app-groovy</module>
     <module>beanvalidation</module>
     <module>webservices</module>
+    <module>ssl</module>
   </modules>
 </project>

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/pom.xml?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/pom.xml (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/pom.xml Wed Dec 27 15:36:52 2017
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+  license agreements. See the NOTICE file distributed with this work for additional 
+  information regarding copyright ownership. The ASF licenses this file to 
+  you under the Apache License, Version 2.0 (the "License"); you may not use 
+  this file except in compliance with the License. You may obtain a copy of 
+  the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+  by applicable law or agreed to in writing, software distributed under the 
+  License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+  OF ANY KIND, either express or implied. See the License for the specific 
+  language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0             http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>integration-tests</artifactId>
+    <groupId>org.apache.meecrowave</groupId>
+    <version>1.2.1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>ssl</artifactId>
+  <packaging>war</packaging>
+  <name>Meecrowave :: Integration Tests :: Ssl</name>
+
+  <properties>
+    <failOnMissingWebXml>false</failOnMissingWebXml>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.meecrowave</groupId>
+      <artifactId>meecrowave-core</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.meecrowave</groupId>
+      <artifactId>meecrowave-junit</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.meecrowave</groupId>
+        <artifactId>meecrowave-maven-plugin</artifactId>
+        <version>${project.version}</version>
+        <configuration>
+          <scanningPackageIncludes>org.apache.meecrowave.tests.ssl</scanningPackageIncludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <reuseForks>false</reuseForks>
+          <forkCount>1</forkCount>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/meecrowave/tests/ssl/HelloWorld.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/meecrowave/tests/ssl/HelloWorld.java?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/meecrowave/tests/ssl/HelloWorld.java (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/java/org/apache/meecrowave/tests/ssl/HelloWorld.java Wed Dec 27 15:36:52 2017
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.meecrowave.tests.ssl;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/")
+@ApplicationScoped
+public class HelloWorld {
+    
+    @GET
+    @Path("hello")
+    @Produces(MediaType.TEXT_PLAIN)
+    public String sayHello() {
+        return "Hello";
+    }
+    
+}

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/ca-chain.cert.pem
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/ca-chain.cert.pem?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/ca-chain.cert.pem (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/ca-chain.cert.pem Wed Dec 27 15:36:52 2017
@@ -0,0 +1,66 @@
+-----BEGIN CERTIFICATE-----
+MIIFuzCCA6OgAwIBAgICQAAwDQYJKoZIhvcNAQELBQAwbTELMAkGA1UEBhMCVVMx
+ETAPBgNVBAgMCE1hcnlsYW5kMRQwEgYDVQQHDAtGb3Jlc3QgSGlsbDEPMA0GA1UE
+CgwGQXBhY2hlMQswCQYDVQQLDAJJVDEXMBUGA1UEAwwOd3d3LmFwYWNoZS5vcmcw
+HhcNMTcxMjIzMTQyNTU2WhcNNDIwNTA2MTQyNTU2WjBXMQswCQYDVQQGEwJVUzER
+MA8GA1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fktUrwx5rb8jtlX9TkTOtc3q0rg
+nfl4WEn87X+p5nUIKKH/5yOmrUd5hGE+83Qy9zaluht2ugAxuL9tsryw8AYEN1rq
+EzNHHP4F/c/fiRyTojcPY+7rCwm6nH1y1Ql5VOHPeIeo3J62prkp3R4zjfv1Qo39
+Kw35eMYkVS1hv+BHrppw66K9ElBAAMXgkGtlFoUsryr4acFLiCWnqvegc4gn+sN/
+JlnsuNUd40oUkAGOaG0HDFaAVXvHqwB00JUt4meU2Xg4TaBDZtBXXIA25FLOWAm9
+Pss5XGcuXzs80vuZR2/+NO/moYlr0VIb3Nb+cHiDW0X0CkIk752vmdSDe4o+ubvF
+SeZClw+DLKOm88HNeaLLyrrKKIu+1EwwopXTMJtZTVeh4rn+J/fE6HYCAqXFQJMP
+nVgVJYSAAFs9n82gQ0gdTvRR2lLzYQUAuWXxC9SkK1CQhMM10HYEDtsktkgFZyp9
+Q2peRRRzlmysH/NggyvVM09KEYxUdYwtrAwc70zmRfEkRh/hqdjRu0r+znegNKp6
+eloYZLAXxlR/ZR24IJvkNbo=
+-----END CERTIFICATE-----

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.cert.pem
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.cert.pem?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.cert.pem (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.cert.pem Wed Dec 27 15:36:52 2017
@@ -0,0 +1,28 @@
+-----BEGIN CERTIFICATE-----
+MIIEwjCCAqqgAwIBAgICQAAwDQYJKoZIhvcNAQELBQAwVzELMAkGA1UEBhMCVVMx
+ETAPBgNVBAgMCE1hcnlsYW5kMQ8wDQYDVQQKDAZBcGFjaGUxCzAJBgNVBAsMAklU
+MRcwFQYDVQQDDA53d3cuYXBhY2hlLm9yZzAeFw0xNzEy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YDhmCTyTa
+Oyd6tdYZ1QM4qmH2dxEA3C4WSjt3fdCKIO1ly7/15sRw+QuG2hP6quofpWMqv6fe
+XWtUey19MnFtyOYTyZ8HdZrbka+85dGDxXCRCyODagcn/fobd2X9G99e9iZNXM3g
+Q7ociiwHJcIjN4MKn4dID9z/2qRyqbRyrRusSFWxnzQytDQ6PV1O+ENRwwOWT0t6
+uU3Zj1eaVu/CKnDwH8CS/79K2VWIh51qkKaw6OwGm5VehLgfxYryVGvE5BkuLdZM
+DNJG0ndhgr0PNPwTYh4p7c9XmBj9Tq9zJ4WX74EXkEY/bGAF4nPvlAGP1XKu1mGF
+sYUQWI2xatvqSXEDkxlV7Oom8Ealq9cIMOGgZMWkq4f5sYUmtdjMmokEa5VoMcYw
+RP2ULWf0IOMefcZ81C5cMhqADct14w==
+-----END CERTIFICATE-----

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.key.pem
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.key.pem?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.key.pem (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave.key.pem Wed Dec 27 15:36:52 2017
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQChv/0pE1xgdrUE
+7yLm1WZrn3ur9+AQeYtoKpnbEwDjo+SDswdXnF34rNo/c/LDhi8lCMQfQalQGa0q
+9PjvxgktiGeZgk8t6JdtObVFBT/vSdJPA9ekb7SdvbX/o62gjH6JWdnYQGY0nRip
+eTqB/Qy7hgc9Ezl6Waqyae2b9Xu3ioXqHl7CwmfaY4TLxPnQl5JEmiMKS+x8fOgV
+lYIxDrSgmKPUmf5IzBrsZkUQLm8GJuspDd/q1WF0dfkNFkNYvPmvH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EIN
+a1j/IXQ9tS0ne+03vGDLjMPHpyDMt2NnGiuxJnUIJ2uD4UgOu/+SfNlE3Fk8xCKf
+zOXCC7hByHmBgiwheJejCII90tjUVG120Hs+6PECgYA1+5vJJBmSyPnve1Hm2CK6
+OA0kfIGtqqfvmQ7a5YK1GlI0v29Xt2U9xmw2N7Br/6y1YysETU6jwuytYagg+e6b
+W+oGLDhS5zpqeMe1d4quulDv7RM5H60b6p8lADGf69zIWQTSiyA9EYm6tHSADBg9
+IOwMedY4u4grIvSp401rGg==
+-----END PRIVATE KEY-----

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_first_host.jks
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_first_host.jks?rev=1819341&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_first_host.jks
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_second_host.jks
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_second_host.jks?rev=1819341&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_second_host.jks
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_trust.jks
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_trust.jks?rev=1819341&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/main/resources/meecrowave_trust.jks
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslDefaultConfigurationTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslDefaultConfigurationTest.java?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslDefaultConfigurationTest.java (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslDefaultConfigurationTest.java Wed Dec 27 15:36:52 2017
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.meecrowave.tests.ssl;
+
+import static org.junit.Assert.assertEquals;
+
+import java.nio.file.Paths;
+import java.util.Properties;
+
+import org.apache.meecrowave.Meecrowave.Builder;
+import org.apache.meecrowave.junit.MeecrowaveRule;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+/*
+ * Creates the following connector
+ * <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" scheme="https" secure="true"
+    sslDefaultHost="_default_">
+    <SSLHostConfig honorCipherOrder="false" hostName="_default_">
+        <Certificate certificateKeystoreFile="meecrowave.jks" 
+                     certificateKeystorePassword="meecrowave" 
+                     certificateKeyAlias="meecrowave" 
+                     truststoreFile = "meecrowave.jks"
+                     truststorePassword = "meecrowave"/>
+    </SSLHostConfig>
+</Connector>
+ */
+
+public class SslDefaultConfigurationTest {
+    private static final String keyStorePath = "meecrowave_first_host.jks";
+    
+    static {
+        System.setProperty("javax.net.ssl.trustStore", Paths.get("").toAbsolutePath() + "/target/classes/meecrowave_trust.jks"); 
+        System.setProperty("javax.net.ssl.trustStorePassword", "meecrowave");
+    }
+    
+    public static final Properties p = new Properties() {{
+        setProperty("connector.sslhostconfig.truststoreFile", "meecrowave_trust.jks");
+        setProperty("connector.sslhostconfig.truststorePassword", "meecrowave");
+    }};
+        
+    @ClassRule
+    public static final MeecrowaveRule CONTAINER = 
+        new MeecrowaveRule(new Builder() {{
+            randomHttpsPort();
+            setSkipHttp(true);
+            includePackages("org.apache.meecrowave.tests.ssl");
+            setSsl(true);
+            setKeystoreFile(keyStorePath);
+            setKeyAlias("meecrowave");
+            setKeystorePass("meecrowave");
+            setProperties(p);
+        }}, "");
+
+    @Test
+    public void run() {
+        assertEquals("Hello", TestSetup.callJaxrsService(CONTAINER.getConfiguration().getHttpsPort()));                                                 
+    }
+}

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslHostConfigPropertiesTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslHostConfigPropertiesTest.java?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslHostConfigPropertiesTest.java (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/SslHostConfigPropertiesTest.java Wed Dec 27 15:36:52 2017
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.meecrowave.tests.ssl;
+
+import static org.junit.Assert.assertEquals;
+
+import java.nio.file.Paths;
+import java.util.Properties;
+
+import org.apache.meecrowave.Meecrowave.Builder;
+import org.apache.meecrowave.junit.MeecrowaveRule;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+/*
+ * Creates the following connector
+ * <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" scheme="https" secure="true"
+    sslDefaultHost="_default_">
+    <SSLHostConfig honorCipherOrder="false" hostName="_default_">
+        <Certificate certificateKeystoreFile="meecrowave.jks" 
+                     certificateKeystorePassword="meecrowave" 
+                     certificateKeyAlias="meecrowave" 
+                     truststoreFile = "meecrowave.jks"
+                     truststorePassword = "meecrowave"/>
+    </SSLHostConfig>
+</Connector>
+ */
+public class SslHostConfigPropertiesTest {
+    private static final String keyStorePath = "meecrowave_first_host.jks";
+    
+    static {
+        System.setProperty("javax.net.ssl.trustStore", Paths.get("").toAbsolutePath() + "/target/classes/meecrowave_trust.jks"); 
+        System.setProperty("javax.net.ssl.trustStorePassword", "meecrowave");
+    }
+    
+    public static final Properties p = new Properties() {{
+        setProperty("connector.sslhostconfig.truststoreFile", "meecrowave_trust.jks");
+        setProperty("connector.sslhostconfig.truststorePassword", "meecrowave");
+        setProperty("connector.sslhostconfig.certificateKeystoreFile", keyStorePath);
+        setProperty("connector.sslhostconfig.certificateKeystoreType", "JKS");
+        setProperty("connector.sslhostconfig.certificateKeystorePassword", "meecrowave");
+        setProperty("connector.sslhostconfig.certificateKeyAlias", "meecrowave");
+    }};
+        
+    @ClassRule
+    public static final MeecrowaveRule CONTAINER = 
+        new MeecrowaveRule(new Builder() {{
+            randomHttpsPort();
+            setSkipHttp(true);
+            includePackages("org.apache.meecrowave.tests.ssl");
+            setSsl(true);
+            setProperties(p);
+        }}, "");
+    
+    @Test
+    public void run() {
+        assertEquals("Hello", TestSetup.callJaxrsService(CONTAINER.getConfiguration().getHttpsPort()));                                                         
+    }
+}

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TestSetup.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TestSetup.java?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TestSetup.java (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TestSetup.java Wed Dec 27 15:36:52 2017
@@ -0,0 +1,19 @@
+package org.apache.meecrowave.tests.ssl;
+
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.core.MediaType;
+
+public class TestSetup {
+    protected static String callJaxrsService(int portNumber) {
+        Client client = ClientBuilder.newBuilder()
+                    .connectTimeout(5, TimeUnit.SECONDS)
+                    .readTimeout(5, TimeUnit.SECONDS)
+                    .build();
+        return client.target("https://localhost:" + portNumber + "/hello")
+                     .request(MediaType.TEXT_PLAIN)
+                     .get(String.class);
+    }
+}

Added: openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TlsVirtualHostPropertiesTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TlsVirtualHostPropertiesTest.java?rev=1819341&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TlsVirtualHostPropertiesTest.java (added)
+++ openwebbeans/meecrowave/trunk/integration-tests/ssl/src/test/java/org/apache/meecrowave/tests/ssl/TlsVirtualHostPropertiesTest.java Wed Dec 27 15:36:52 2017
@@ -0,0 +1,136 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.meecrowave.tests.ssl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Properties;
+
+import org.apache.meecrowave.Meecrowave;
+import org.apache.meecrowave.Meecrowave.Builder;
+import org.apache.tomcat.util.net.SSLHostConfig;
+import org.junit.Test;
+
+/*
+ * Creates the following connector
+ * <Connector port="8443" protocol="HTTP/1.1" maxThreads="10" SSLEnabled="true" scheme="https" secure="true"
+    sslDefaultHost="*meecrowave-localhost">
+    <SSLHostConfig honorCipherOrder="false" hostName="localhost">
+        <Certificate certificateKeystoreFile="meecrowave.jks" 
+                     certificateKeystorePassword="meecrowave" 
+                     certificateKeyAlias="meecrowave"
+                     truststoreFile = "meecrowave.jks"
+                     truststorePassword = "meecrowave" />
+    </SSLHostConfig>
+    <SSLHostConfig honorCipherOrder="false" hostName="meecrowave-locahost">
+        <Certificate certificateKeystoreFile="meecrowave_second_host.jks"
+                     certificateKeystorePassword="meecrowave"
+                     certificateKeyAlias="meecrowave" />
+    </SSLHostConfig>
+    <SSLHostConfig honorCipherOrder="false" hostName="meecrowave.apacge.org">
+        <Certificate certificateKeyFile="meecrowave.key.pem"
+                     certificateFile="meecrowave.cert.pem"
+                     certificateChainFile="ca-chain.cert.pem" />
+    </SSLHostConfig>
+</Connector>
+ */
+
+public class TlsVirtualHostPropertiesTest {
+    private static final String keyStorePath1 = "meecrowave_first_host.jks";
+    private static final String keyStorePath2 = "meecrowave_second_host.jks";
+    
+    static {
+        System.setProperty("javax.net.ssl.trustStore", Paths.get("").toAbsolutePath() + "/target/classes/meecrowave_trust.jks"); 
+        System.setProperty("javax.net.ssl.trustStorePassword", "meecrowave");
+    }
+    
+    public static final Properties p = new Properties() {{
+        setProperty("connector.attributes.maxThreads", "10");
+        
+        setProperty("connector.sslhostconfig.certificateKeystoreFile", keyStorePath1);
+        setProperty("connector.sslhostconfig.certificateKeystoreType", "JKS");
+        setProperty("connector.sslhostconfig.certificateKeystorePassword", "meecrowave");
+        setProperty("connector.sslhostconfig.certificateKeyAlias", "meecrowave");
+        setProperty("connector.sslhostconfig.hostName", "localhost");
+        setProperty("connector.sslhostconfig.truststoreFile", "meecrowave_trust.jks");
+        setProperty("connector.sslhostconfig.truststorePassword", "meecrowave");
+        
+        setProperty("connector.sslhostconfig.1.certificateKeystoreFile", keyStorePath2);
+        setProperty("connector.sslhostconfig.1.certificateKeystoreType", "JKS");
+        setProperty("connector.sslhostconfig.1.certificateKeystorePassword", "meecrowave");
+        setProperty("connector.sslhostconfig.1.certificateKeyAlias", "meecrowave");
+        setProperty("connector.sslhostconfig.1.protocols", "TLSv1.1,TLSv1.2");
+        setProperty("connector.sslhostconfig.1.hostName", "meecrowave-localhost");
+        
+        setProperty("connector.sslhostconfig.2.hostName", "meecrowave.apache.org");
+        setProperty("connector.sslhostconfig.2.certificateKeyFile", "meecrowave.key.pem");
+        setProperty("connector.sslhostconfig.2.certificateFile", "meecrowave.cert.pem");
+        setProperty("connector.sslhostconfig.2.certificateChainFile", "ca-chain.cert.pem");
+        setProperty("connector.sslhostconfig.2.protocols", "TLSv1.2");
+    
+    }};
+    
+    @Test
+    public void run() throws IOException {
+        try (final Meecrowave CONTAINER = new Meecrowave(new Builder() {{
+                    randomHttpsPort();
+                    setSkipHttp(true);
+                    includePackages("org.apache.meecrowave.tests.ssl");
+                    setSsl(true);
+                    setDefaultSSLHostConfigName("localhost");
+                    setTomcatNoJmx(false);
+                    setProperties(p);
+                }}).bake()) {
+        final String confPath = CONTAINER.getBase().getCanonicalPath() + "/conf/";
+        SSLHostConfig[] sslHostConfigs = CONTAINER.getTomcat().getService().findConnectors()[0].findSslHostConfigs();
+        assertEquals(3, sslHostConfigs.length);
+        assertTrue(isFilesSame(confPath + keyStorePath1, sslHostConfigs[0].getCertificateKeystoreFile()));
+        assertEquals("JKS", sslHostConfigs[0].getCertificateKeystoreType());
+        assertEquals("meecrowave", sslHostConfigs[0].getCertificateKeystorePassword());
+        assertEquals("meecrowave", sslHostConfigs[0].getCertificateKeyAlias());
+        assertEquals("localhost", sslHostConfigs[0].getHostName());
+        assertTrue(isFilesSame(confPath + "meecrowave_trust.jks", sslHostConfigs[0].getTruststoreFile()));
+        assertEquals("meecrowave", sslHostConfigs[0].getTruststorePassword());
+        
+        assertTrue(isFilesSame(confPath + keyStorePath2, sslHostConfigs[1].getCertificateKeystoreFile()));
+        assertEquals("JKS", sslHostConfigs[1].getCertificateKeystoreType());
+        assertEquals("meecrowave", sslHostConfigs[1].getCertificateKeystorePassword());
+        assertEquals("meecrowave", sslHostConfigs[1].getCertificateKeyAlias());
+        assertEquals("meecrowave-localhost", sslHostConfigs[1].getHostName());
+        assertEquals(2, sslHostConfigs[1].getProtocols().size());
+        
+        assertEquals("meecrowave.apache.org", sslHostConfigs[2].getHostName());
+        assertTrue(isFilesSame(confPath + "meecrowave.key.pem", sslHostConfigs[2].getCertificateKeyFile()));
+        assertTrue(isFilesSame(confPath + "meecrowave.cert.pem", sslHostConfigs[2].getCertificateFile()));
+        assertTrue(isFilesSame(confPath + "ca-chain.cert.pem", sslHostConfigs[2].getCertificateChainFile()));
+        assertEquals("TLSv1.2", sslHostConfigs[2].getProtocols().toArray()[0]);
+        
+        assertEquals("Hello", TestSetup.callJaxrsService(CONTAINER.getConfiguration().getHttpsPort()));        
+        }
+    }
+    
+    boolean isFilesSame(final String input, final String output) throws IOException {
+        return Files.isSameFile(Paths.get(input), Paths.get(output));
+    }
+}

Modified: openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java?rev=1819341&r1=1819340&r2=1819341&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-arquillian/src/main/java/org/apache/meecrowave/arquillian/MeecrowaveConfiguration.java Wed Dec 27 15:36:52 2017
@@ -104,6 +104,7 @@ public class MeecrowaveConfiguration imp
     private boolean jaxrsAutoActivateBeanValidation = true;
     private String meecrowaveProperties = "meecrowave.properties";
     private boolean jaxwsSupportIfAvailable = true;
+    private String defaultSSLHostConfigName;
 
     // configurable cause when set to Local arquillian bypass some protocol configuration cause of container default
     private String arquillianProtocol = "Servlet 3.1";
@@ -766,4 +767,13 @@ public class MeecrowaveConfiguration imp
     public void setJaxwsSupportIfAvailable(final boolean jaxwsSupportIfAvailable) {
         this.jaxwsSupportIfAvailable = jaxwsSupportIfAvailable;
     }
+
+    public String getDefaultSSLHostConfigName() {
+        return defaultSSLHostConfigName;
+    }
+
+    public void setDefaultSSLHostConfigName(String defaultSSLHostConfigName) {
+        this.defaultSSLHostConfigName = defaultSSLHostConfigName;
+    }
+    
 }

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java?rev=1819341&r1=1819340&r2=1819341&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java Wed Dec 27 15:36:52 2017
@@ -22,6 +22,7 @@ import static java.util.Collections.empt
 import static java.util.Collections.emptySet;
 import static java.util.Optional.ofNullable;
 import static java.util.stream.Collectors.toList;
+import static java.util.stream.Collectors.toSet;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -39,6 +40,10 @@ import java.net.ServerSocket;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
 import java.util.Base64;
 import java.util.Collection;
@@ -550,40 +555,64 @@ public class Meecrowave implements AutoC
             final Connector httpsConnector = createConnector();
             httpsConnector.setPort(configuration.httpsPort);
             httpsConnector.setSecure(true);
+            httpsConnector.setScheme("https");
             httpsConnector.setProperty("SSLEnabled", "true");
-            httpsConnector.setProperty("sslProtocol", configuration.sslProtocol);
-
+            if (configuration.sslProtocol != null) {
+                configuration.property("connector.sslhostconfig.sslProtocol", configuration.sslProtocol);
+            }
+            if (configuration.properties.getProperty("connector.sslhostconfig.hostName") != null) {
+                httpsConnector.setAttribute("defaultSSLHostConfigName", configuration.properties.getProperty("connector.sslhostconfig.hostName"));
+            }
             if (configuration.keystoreFile != null) {
-                httpsConnector.setAttribute("keystoreFile", configuration.keystoreFile);
+                configuration.property("connector.sslhostconfig.certificateKeystoreFile", configuration.keystoreFile);
             }
             if (configuration.keystorePass != null) {
-                httpsConnector.setAttribute("keystorePass", configuration.keystorePass);
+                configuration.property("connector.sslhostconfig.certificateKeystorePassword", configuration.keystorePass);
             }
-            httpsConnector.setAttribute("keystoreType", configuration.keystoreType);
+            configuration.property("connector.sslhostconfig.certificateKeystoreType", configuration.keystoreType);
             if (configuration.clientAuth != null) {
                 httpsConnector.setAttribute("clientAuth", configuration.clientAuth);
             }
 
             if (configuration.keyAlias != null) {
-                httpsConnector.setAttribute("keyAlias", configuration.keyAlias);
+                configuration.property("connector.sslhostconfig.certificateKeyAlias", configuration.keyAlias);
             }
+            if (configuration.http2) {
+                httpsConnector.addUpgradeProtocol(new Http2Protocol());
+            }
+            final List<SSLHostConfig> buildSslHostConfig = buildSslHostConfig();
+            buildSslHostConfig.forEach(sslHostConf -> {
+                if (isCertificateFromClasspath(sslHostConf.getCertificateKeystoreFile())) {
+                    copyCertificateToConfDir(sslHostConf.getCertificateKeystoreFile());
+                    sslHostConf.setCertificateKeystoreFile(base.getAbsolutePath() + "/conf/" + sslHostConf.getCertificateKeystoreFile());
+                }
+                if (isCertificateFromClasspath(sslHostConf.getCertificateKeyFile())) {
+                    copyCertificateToConfDir(sslHostConf.getCertificateKeyFile());
+                    sslHostConf.setCertificateKeyFile(base.getAbsolutePath() + "/conf/" + sslHostConf.getCertificateKeyFile());
+                    copyCertificateToConfDir(sslHostConf.getCertificateFile());
+                    sslHostConf.setCertificateFile(base.getAbsolutePath() + "/conf/" + sslHostConf.getCertificateFile());
+                }
+                if (isCertificateFromClasspath(sslHostConf.getTruststoreFile())) {
+                    copyCertificateToConfDir(sslHostConf.getTruststoreFile());
+                    sslHostConf.setTruststoreFile(base.getAbsolutePath() + "/conf/" + sslHostConf.getTruststoreFile());
+                }
+                if (isCertificateFromClasspath(sslHostConf.getCertificateChainFile())) {
+                    copyCertificateToConfDir(sslHostConf.getCertificateChainFile());
+                    sslHostConf.setCertificateChainFile(base.getAbsolutePath() + "/conf/" + sslHostConf.getCertificateChainFile());
+                }
+            });
+            
+            buildSslHostConfig.forEach(httpsConnector::addSslHostConfig);
 
+            if (configuration.defaultSSLHostConfigName != null) {
+                httpsConnector.setAttribute("defaultSSLHostConfigName", configuration.defaultSSLHostConfigName);
+            }
             tomcat.getService().addConnector(httpsConnector);
-
             if (configuration.skipHttp) {
                 tomcat.setConnector(httpsConnector);
             }
         }
 
-        if (configuration.http2) {
-            final Connector c = configuration.ssl ?
-                    tomcat.getService().findConnectors()[tomcat.getService().findConnectors().length - 1] :
-                    ofNullable(tomcat.getRawConnector()).orElse(tomcat.getService().findConnectors()[0]);
-
-            c.addUpgradeProtocol(new Http2Protocol());
-            c.addSslHostConfig(buildSslHostConfig());
-        }
-
         for (final Connector c : configuration.connectors) {
             tomcat.getService().addConnector(c);
         }
@@ -648,6 +677,34 @@ public class Meecrowave implements AutoC
         return this;
     }
 
+    private boolean isCertificateFromClasspath(String certificate) {
+        return certificate != null && !(new File(certificate).exists()) 
+                && !(Paths.get(System.getProperty("user.home"))
+                          .resolve(".keystore")
+                          .toString().equalsIgnoreCase(certificate));
+    }
+    
+    private void copyCertificateToConfDir(String certificate) {
+        InputStream resourceAsStream = null;
+        try {
+            final Path dstFile = Paths.get(base.getAbsolutePath() + "/conf/" + certificate);
+            resourceAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(certificate);
+            if (resourceAsStream == null) {
+                resourceAsStream = new FileInputStream(new File((this.getClass().getResource("/").toString().replaceAll("file:", "") + "/" + certificate)));
+            }
+            Files.copy(resourceAsStream, dstFile, StandardCopyOption.REPLACE_EXISTING);
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
+        } finally {
+            if (resourceAsStream != null) {
+                try {
+                    resourceAsStream.close();
+                } catch (IOException e) {
+                    throw new IllegalStateException(e);
+                }
+            }
+        }
+    }
 
     /**
      * Store away the current system property for restoring it later
@@ -717,16 +774,42 @@ public class Meecrowave implements AutoC
         }
     }
 
-    private SSLHostConfig buildSslHostConfig() {
-        final ObjectRecipe recipe = new ObjectRecipe(SSLHostConfig.class);
+    private List<SSLHostConfig> buildSslHostConfig() {
+        final List<SSLHostConfig> sslHostConfigs = new ArrayList<>();
+        // Configures default SSLHostConfig
+        final ObjectRecipe defaultSslHostConfig = new ObjectRecipe(SSLHostConfig.class);
         for (final String key : configuration.properties.stringPropertyNames()) {
-            if (!key.startsWith("connector.sslhostconfig.")) {
-                continue;
+            if (key.startsWith("connector.sslhostconfig.") && key.split("\\.").length == 3) {
+                final String substring = key.substring("connector.sslhostconfig.".length());
+                defaultSslHostConfig.setProperty(substring, configuration.properties.getProperty(key));
+            }
+        }
+        if (!defaultSslHostConfig.getProperties().isEmpty()) {
+            sslHostConfigs.add(SSLHostConfig.class.cast(defaultSslHostConfig.create()));
+        }
+        // Allows to add N Multiple SSLHostConfig elements not including the default one.
+        final Collection<Integer> itemNumbers = configuration.properties.stringPropertyNames()
+                                .stream()
+                                .filter(key -> (key.startsWith("connector.sslhostconfig.") && key.split("\\.").length == 4))
+                                .map(key -> Integer.parseInt(key.split("\\.")[2]))
+                                .collect(toSet());
+        itemNumbers.stream().sorted().forEach(itemNumber -> {
+            final ObjectRecipe recipe = new ObjectRecipe(SSLHostConfig.class);
+            final String prefix = "connector.sslhostconfig." + itemNumber + '.';
+            configuration.properties.stringPropertyNames().stream()
+                                    .filter(k -> k.startsWith(prefix))
+                                    .forEach(key -> {
+                                        final String keyName = key.split("\\.")[3];
+                                        recipe.setProperty(keyName, configuration.properties.getProperty(key));
+                                    });
+            if (!recipe.getProperties().isEmpty()) {
+                final SSLHostConfig sslHostConfig = SSLHostConfig.class.cast(recipe.create());
+                sslHostConfigs.add(sslHostConfig);
+                new LogFacade(Meecrowave.class.getName())
+                        .info("Created SSLHostConfig #" + itemNumber + " (" + sslHostConfig.getHostName() + ")");
             }
-            final String substring = key.substring("connector.sslhostconfig.".length());
-            recipe.setProperty(substring, configuration.properties.getProperty(key));
-        }
-        return SSLHostConfig.class.cast(recipe.create());
+        });
+        return sslHostConfigs;
     }
 
     protected void beforeStart() {
@@ -898,26 +981,10 @@ public class Meecrowave implements AutoC
             return dirFile.getAbsolutePath();
         }
 
-        final File file = Stream.concat(
-                    // bundle uses that with a high priority since it is the expected behavior
-                    ofNullable(System.getProperty("meecrowave.base"))
-                        .map(File::new)
-                        .filter(File::isDirectory)
-                        .map(base -> new File(base, "temp"))
-                        .map(location -> {
-                            IO.mkdirs(location);
-                            return location;
-                        })
-                        .map(File::getAbsolutePath)
-                        .map(Stream::of)
-                        .orElseGet(Stream::empty),
-                    // test common build locations - else set configuration.dir if you don't use a default setup
-                    Stream.of("target", "build"))
+        final File file = new File(Stream.of(new File(System.getProperty("meecrowave.base", "."), "temp").getAbsolutePath(), "target", "build", ".")
                 .map(File::new)
                 .filter(File::isDirectory)
-                .findFirst()
-                .map(file1 -> new File(file1, "meecrowave-" + System.nanoTime()))
-                .orElse(ownedTempDir);
+                .findFirst().get(), "meecrowave-" + System.nanoTime());
         IO.mkdirs(file);
         return file.getAbsolutePath();
     }
@@ -1142,6 +1209,9 @@ public class Meecrowave implements AutoC
 
         @CliOption(name = "jaxws-support-if-present", description = "Should @WebService CDI beans be deployed if cxf-rt-frontend-jaxws is in the classpath.")
         private boolean jaxwsSupportIfAvailable = true;
+        
+        @CliOption(name = "default-ssl-hostconfig-name", description = "The name of the default SSLHostConfig that will be used for secure https connections.")
+        private String defaultSSLHostConfigName;
 
         private final Map<Class<?>, Object> extensions = new HashMap<>();
         private final Collection<Consumer<Tomcat>> instanceCustomizers = new ArrayList<>();
@@ -1700,6 +1770,15 @@ public class Meecrowave implements AutoC
             }
             return this;
         }
+        
+        public Builder randomHttpsPort() {
+            try (final ServerSocket serverSocket = new ServerSocket(0)) {
+                this.httpsPort = serverSocket.getLocalPort();
+            } catch (final IOException e) {
+                throw new IllegalStateException(e);
+            }
+            return this;
+        }
 
         public Builder loadFrom(final String resource) {
             try (final InputStream is = findStream(resource)) {
@@ -1832,6 +1911,14 @@ public class Meecrowave implements AutoC
             this.useLog4j2JulLogManager = useLog4j2JulLogManager;
         }
 
+        public String getDefaultSSLHostConfigName() {
+            return defaultSSLHostConfigName;
+        }
+
+        public void setDefaultSSLHostConfigName(final String defaultSSLHostConfigName) {
+            this.defaultSSLHostConfigName = defaultSSLHostConfigName;
+        }
+
         public void loadFromProperties(final Properties config) {
             // filtering properties with system properties or themself
             final StrSubstitutor strSubstitutor = new StrSubstitutor(new StrLookup<String>() {

Modified: openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java?rev=1819341&r1=1819340&r2=1819341&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveExtension.java Wed Dec 27 15:36:52 2017
@@ -95,6 +95,7 @@ public class MeecrowaveExtension {
     private boolean jaxrsAutoActivateBeanValidation = true;
     private String meecrowaveProperties = "meecrowave.properties";
     private boolean jaxwsSupportIfAvailable = true;
+    private String defaultSSLHostConfigName;
 
     public boolean isJaxwsSupportIfAvailable() {
         return jaxwsSupportIfAvailable;
@@ -655,4 +656,13 @@ public class MeecrowaveExtension {
     public void setWatcherBouncing(final int watcherBouncing) {
         this.watcherBouncing = watcherBouncing;
     }
+
+    public String getDefaultSSLHostConfigName() {
+        return defaultSSLHostConfigName;
+    }
+
+    public void setDefaultSSLHostConfigName(String defaultSSLHostConfigName) {
+        this.defaultSSLHostConfigName = defaultSSLHostConfigName;
+    }
+    
 }

Modified: openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java?rev=1819341&r1=1819340&r2=1819341&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-gradle-plugin/src/main/java/org/apache/meecrowave/gradle/MeecrowaveTask.java Wed Dec 27 15:36:52 2017
@@ -340,6 +340,10 @@ public class MeecrowaveTask extends Defa
     @Optional
     private boolean jaxwsSupportIfAvailable = true;
 
+    @Input
+    @Optional
+    private String defaultSSLHostConfigName;
+
     @TaskAction
     public void bake() {
         fixConfig();
@@ -1172,4 +1176,12 @@ public class MeecrowaveTask extends Defa
     public void setJaxwsSupportIfAvailable(final boolean jaxwsSupportIfAvailable) {
         this.jaxwsSupportIfAvailable = jaxwsSupportIfAvailable;
     }
+
+    public String getDefaultSSLHostConfigName() {
+        return defaultSSLHostConfigName;
+    }
+
+    public void setDefaultSSLHostConfigName(final String defaultSSLHostConfigName) {
+        this.defaultSSLHostConfigName = defaultSSLHostConfigName;
+    }
 }

Modified: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java?rev=1819341&r1=1819340&r2=1819341&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java Wed Dec 27 15:36:52 2017
@@ -284,6 +284,9 @@ public class MeecrowaveRunMojo extends A
     @Parameter(property = "meecrowave.jaxws-support", defaultValue = "true")
     private boolean jaxwsSupportIfAvailable;
 
+    @Parameter(property = "meecrowave.default-ssl-hostconfig-name")
+    private String defaultSSLHostConfigName;
+
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
         if (skip) {



Mime
View raw message