You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2020/02/17 17:40:21 UTC
[cxf] branch master updated: Log error in the
AllowAllHostnameVerifier
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new 7934eff Log error in the AllowAllHostnameVerifier
7934eff is described below
commit 7934eff013f36b1156ab117f6e2f87343b93abee
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Feb 17 17:37:14 2020 +0000
Log error in the AllowAllHostnameVerifier
---
.../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");
}
}