Skip to content

Commit b912bbb

Browse files
committed
add some logging, build for jdk 11
1 parent 200cb75 commit b912bbb

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

pom.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@
105105
<artifactId>maven-compiler-plugin</artifactId>
106106
<version>3.5.1</version>
107107
<configuration>
108-
<source>1.8</source>
109-
<target>1.8</target>
108+
<release>11</release>
110109
</configuration>
111110
</plugin>
112111
<plugin>

src/main/java/com/github/shyiko/mysql/binlog/network/HostnameChecker.java

+13
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
import java.util.List;
6262
import java.util.NoSuchElementException;
6363
import java.util.TreeSet;
64+
import java.util.logging.Level;
65+
import java.util.logging.Logger;
6466

6567
/**
6668
* Interface for checking if a hostname matches the names stored inside the
@@ -221,6 +223,8 @@ public final void check(final String[] host, final String[] cns,
221223
};
222224

223225
abstract class AbstractChecker implements HostnameChecker {
226+
private final Logger logger = Logger.getLogger(getClass().getName());
227+
224228
public static String[] getCNs(X509Certificate cert) {
225229
try {
226230
final String subjectPrincipal = cert.getSubjectX500Principal().getName(X500Principal.RFC2253);
@@ -406,10 +410,19 @@ is presenting (e.g. edit "/etc/apache2/server.crt"
406410
check(host, x509);
407411
}
408412

413+
private String commaJoin(String [] input) {
414+
if ( input == null ) return "";
415+
return String.join(",", Arrays.asList(input));
416+
}
417+
409418
public void check(String[] host, X509Certificate cert)
410419
throws SSLException {
411420
String[] cns = AbstractChecker.getCNs(cert);
412421
String[] subjectAlts = AbstractChecker.getDNSSubjectAlts(cert);
422+
logger.log(Level.INFO,
423+
"attempting to verify SSL identity '" + commaJoin(host) + "' " +
424+
"against cns: [" + commaJoin(cns) + "], " +
425+
"subject-alts: [" + commaJoin(subjectAlts) + "]");
413426
check(host, cns, subjectAlts);
414427
}
415428

0 commit comments

Comments
 (0)