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 05:15:36 UTC

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

rgoers 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_r253349277
 
 

 ##########
 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:
   HostNameVerifier? I copied this code from the HttpAppender but since we haven't configured yet I had to get creative in how the SSL settings would be obtained.

----------------------------------------------------------------
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