Skip to content

Commit 00714c2

Browse files
authored
Merge pull request #142 from fivetran/optional-verify-identity
Don't verify identity for REQUIRED or PREFERRED
2 parents e4e5dc5 + 0a14876 commit 00714c2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/com/github/shyiko/mysql/binlog/BinaryLogClient.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,12 @@ private void authenticate(GreetingPacket greetingPacket) throws IOException {
530530
SSLRequestCommand sslRequestCommand = new SSLRequestCommand();
531531
sslRequestCommand.setCollation(collation);
532532
channel.write(sslRequestCommand, packetNumber++);
533-
SSLSocketFactory sslSocketFactory = this.sslSocketFactory != null ? this.sslSocketFactory :
534-
sslMode == SSLMode.REQUIRED ? DEFAULT_REQUIRED_SSL_MODE_SOCKET_FACTORY :
535-
DEFAULT_VERIFY_CA_SSL_MODE_SOCKET_FACTORY;
533+
SSLSocketFactory sslSocketFactory =
534+
this.sslSocketFactory != null ?
535+
this.sslSocketFactory :
536+
sslMode == SSLMode.REQUIRED || sslMode == SSLMode.PREFERRED ?
537+
DEFAULT_REQUIRED_SSL_MODE_SOCKET_FACTORY :
538+
DEFAULT_VERIFY_CA_SSL_MODE_SOCKET_FACTORY;
536539
channel.upgradeToSSL(sslSocketFactory,
537540
sslMode == SSLMode.VERIFY_IDENTITY ? new TLSHostnameVerifier() : null);
538541
}

0 commit comments

Comments
 (0)