shyiko / mysql-binlog-connector-java

MySQL Binary Log connector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSL with client certificate failed

qingw1983 opened this issue · comments

when I try to connect to mysql 5.7+ with ssl and client certificate , it failed with exception: com.github.shyiko.mysql.binlog.network.AuthenticationException: Access denied for user 'test_cert'@'10.100.124.33' (using password: YES)
at com.github.shyiko.mysql.binlog.BinaryLogClient.authenticate(BinaryLogClient.java:728)
at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:515). However, it works with mysql driver.

The user I created is as below:

CREATE USER test_cert@'%' IDENTIFIED BY '*******' REQUIRE X509;

GRANT SELECT, REPLICATION SLAVE, REPLICATION CLIENT ON . TO test_cert@'%';

and the certificate setting is like :
System.setProperty("javax.net.ssl.keyStore","/desktop/TLS/keystore");
System.setProperty("javax.net.ssl.keyStorePassword","mypassword");

the reference is : https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-using-ssl.html
https://dev.mysql.com/doc/refman/8.0/en/create-user.html#create-user-tls

commented

@qingw1983 May I ask if this problem was resolved later?