Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +---------------+--------------------------------+
- | Variable_name | Value |
- +---------------+--------------------------------+
- | have_openssl | YES |
- | have_ssl | YES |
- | ssl_ca | /var/lib/mysql/ca.pem |
- | ssl_capath | |
- | ssl_cert | /var/lib/mysql/server-cert.pem |
- | ssl_cipher | |
- | ssl_crl | |
- | ssl_crlpath | |
- | ssl_key | /var/lib/mysql/server-key.pem |
- import java.sql.*;
- public class MysqlConnect
- {
- public static void main (String[] args)
- {
- try
- {
- //System.setProperty("javax.net.ssl.trustStore", "cacerts");
- //System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); ( Works with truststore values , but gives the error below without it)
- Class.forName("com.mysql.jdbc.Driver").newInstance();
- String url = "jdbc:mysql://IPAddress:3306/DBName?
- verifyServerCertificate=false&useSSL=true&requireSSL=true";
- String user = "root";
- String password = "password";
- Connection con = DriverManager.getConnection(url,user,password);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
- }
- javax.net.ssl.SSLHandshakeException
- MESSAGE: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- STACKTRACE:
- javax.net.ssl.SSLHandshakeException:
- sun.security.validator.ValidatorException: PKIX path building failed:
- sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- at sun.security.ssl.Alerts.getSSLException(Unknown Source)
- at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
- at sun.security.ssl.Handshaker.fatalSE(Unknown Source) .
- 1 source IP Dest IP TLSv1.2 220 Client Hello
- 2 Dest IP source IP TLSv1.2 1140 Server Hello, Certificate, Server Key Exchange, Server Hello Done
- 3 source IP Dest IP TLSv1.2 129 Client Key Exchange
- 4 source IP Dest IP TLSv1.2 60 Change Cipher Spec
- 5 source IP Dest IP TLSv1.2 99 Encrypted Handshake Message
Add Comment
Please, Sign In to add comment