You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2019/02/04 20:10:38 UTC

[GitHub] jvz commented on a change in pull request #253: Log4 j2 913 - Add support for HTTP/S configuration monitoring. Support Spring Cloud Config

jvz commented on a change in pull request #253: Log4 j2 913 - Add support for HTTP/S configuration monitoring. Support Spring Cloud Config
URL: https://github.com/apache/logging-log4j2/pull/253#discussion_r253626894
 
 

 ##########
 File path: log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
 ##########
 @@ -294,7 +302,22 @@ static String extractClassLoaderUriPath(final URI uri) {
     protected ConfigurationSource getInputFromString(final String config, final ClassLoader loader) {
         try {
             final URL url = new URL(config);
-            return new ConfigurationSource(url.openStream(), FileUtils.fileFromUri(url.toURI()));
+            URLConnection urlConnection = url.openConnection();
+            if (url.getProtocol().equals(HTTPS)) {
+                SslConfiguration sslConfiguration = SslConfigurationFactory.getSslConfiguration();
+                if (sslConfiguration != null) {
+                    ((HttpsURLConnection) urlConnection).setSSLSocketFactory(sslConfiguration.getSslSocketFactory());
+                    if (!sslConfiguration.isVerifyHostName()) {
+                        ((HttpsURLConnection) urlConnection).setHostnameVerifier(LaxHostnameVerifier.INSTANCE);
 
 Review comment:
   So do we need a separate mechanism to allow this to be configured, too?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services