openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1835217 - in /openwebbeans/meecrowave/trunk: meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java meecrowave-letsencrypt/
Date Fri, 06 Jul 2018 08:34:42 GMT
Author: rmannibucau
Date: Fri Jul  6 08:34:41 2018
New Revision: 1835217

URL: http://svn.apache.org/viewvc?rev=1835217&view=rev
Log:
MEECROWAVE-124 adding a let's encrypt extension

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
    openwebbeans/meecrowave/trunk/meecrowave-letsencrypt/   (props changed)

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=1835217&r1=1835216&r2=1835217&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
Fri Jul  6 08:34:41 2018
@@ -649,7 +649,7 @@ public class Meecrowave implements AutoC
                     sslHostConf.setCertificateChainFile(base.getAbsolutePath() + "/conf/"
+ sslHostConf.getCertificateChainFile());
                 }
             });
-            
+
             buildSslHostConfig.forEach(httpsConnector::addSslHostConfig);
 
             if (configuration.defaultSSLHostConfigName != null) {
@@ -682,6 +682,11 @@ public class Meecrowave implements AutoC
         }
 
         StreamSupport.stream(ServiceLoader.load(Meecrowave.InstanceCustomizer.class).spliterator(),
false)
+                .peek(i -> {
+                    if (MeecrowaveAwareInstanceCustomizer.class.isInstance(i)) {
+                        MeecrowaveAwareInstanceCustomizer.class.cast(i).setMeecrowave(this);
+                    }
+                })
                 .forEach(c -> c.accept(tomcat));
         configuration.instanceCustomizers.forEach(c -> c.accept(tomcat));
 
@@ -736,12 +741,12 @@ public class Meecrowave implements AutoC
     private boolean isCertificateFromClasspath(final String certificate) {
         final BiPredicate<String, String> equals = System.getProperty("os.name", "ignore").toLowerCase(ROOT).contains("win")
?
                 String::equalsIgnoreCase : String::equals;
-        return certificate != null && !(new File(certificate).exists()) 
+        return certificate != null && !(new File(certificate).exists())
                 && !equals.test(
                         Paths.get(System.getProperty("user.home")).resolve(".keystore").toAbsolutePath().normalize().toString(),
                         Paths.get(certificate).toAbsolutePath().normalize().toString());
     }
-    
+
     private void copyCertificateToConfDir(String certificate) {
         InputStream resourceAsStream = null;
         try {
@@ -1329,7 +1334,7 @@ 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;
 
@@ -1941,7 +1946,7 @@ public class Meecrowave implements AutoC
             }
             return this;
         }
-        
+
         public Builder randomHttpsPort() {
             try (final ServerSocket serverSocket = new ServerSocket(0)) {
                 this.httpsPort = serverSocket.getLocalPort();
@@ -2596,6 +2601,11 @@ public class Meecrowave implements AutoC
     public interface InstanceCustomizer extends Consumer<Tomcat> {
     }
 
+    // since it is too early to have CDI and lookup the instance we must set it manually
+    public interface MeecrowaveAwareInstanceCustomizer extends InstanceCustomizer {
+        void setMeecrowave(Meecrowave meecrowave);
+    }
+
     private static final class MeecrowaveContainerLoader extends URLClassLoader {
         private MeecrowaveContainerLoader(final URL[] urls, final ClassLoader parent) {
             super(urls, parent);

Propchange: openwebbeans/meecrowave/trunk/meecrowave-letsencrypt/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jul  6 08:34:41 2018
@@ -0,0 +1 @@
+target



Mime
View raw message