This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.3.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 9987ba3645d65d119b45913e83bf34deab7909f6
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Mon Feb 17 17:37:14 2020 +0000

    Log error in the AllowAllHostnameVerifier
    
    (cherry picked from commit 7934eff013f36b1156ab117f6e2f87343b93abee)
---
 .../org/apache/cxf/transport/https/AllowAllHostnameVerifier.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/AllowAllHostnameVerifier.java
 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/AllowAllHostnameVerifier.java
index 5fb26ed..bde0d14 100644
--- 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/AllowAllHostnameVerifier.java
+++ 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/AllowAllHostnameVerifier.java
@@ -21,21 +21,30 @@ package org.apache.cxf.transport.https;
 
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLSession;
 
+import org.apache.cxf.common.logging.LogUtils;
+
 /**
  * Allow all hostnames. This is only suitable for use in testing, and NOT in 
production!
  */
 class AllowAllHostnameVerifier implements javax.net.ssl.HostnameVerifier {
 
+    private static final Logger LOG = 
LogUtils.getL7dLogger(AllowAllHostnameVerifier.class);
+
     @Override
     public boolean verify(String host, SSLSession session) {
         try {
             Certificate[] certs = session.getPeerCertificates();
             return certs != null && certs[0] instanceof X509Certificate;
         } catch (SSLException e) {
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, e.getMessage(), e);
+            }
             throw new RuntimeException("HostnameVerifier, socket reset for 
TTL");
         }
     }

Reply via email to