​Gayan,

What is the JRE version that das runs on and what are the allowed TLS
versions on Mysql RDS. 'SHOW GLOBAL STATUS LIKE 'Ssl_version';' can be used
to get TLS version of mysql.

After figuring these two out we can do the necessary changes to match the
versions. Also please note the you can use -Djavax.net.debug=all system
property to log SSL handshake which will be useful to debug this. ​Below
reference will also help you[1].

[1]
https://dev.mysql.com/doc/refman/5.7/en/encrypted-connection-protocols-ciphers.html

/Tishan



On Thu, Sep 7, 2017 at 3:47 PM, Gayan Yalpathwala <gay...@wso2.com> wrote:

> Hi team,
>
> I am getting the below error when connecting to an RDS in AWS. This
> datasource is added in analytics-datasources.xml and I refer to it while
> reading some data into the spark context.
>
> Caused by: 
> com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
> Could not create connection to database server. Attempted reconnect 3
> times. Giving up.
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:62)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
> at com.mysql.jdbc.Util.getInstance(Util.java:408)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
> at com.mysql.jdbc.ConnectionImpl.connectWithRetries(
> ConnectionImpl.java:2115)
> at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2040)
> at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790)
> at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
> at sun.reflect.GeneratedConstructorAccessor161.newInstance(Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
> at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)
> at com.mysql.jdbc.NonRegisteringDriver.connect(
> NonRegisteringDriver.java:330)
> at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(
> PooledConnection.java:278)
> at org.apache.tomcat.jdbc.pool.PooledConnection.connect(
> PooledConnection.java:182)
> at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(
> ConnectionPool.java:701)
> at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(
> ConnectionPool.java:635)
> at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(
> ConnectionPool.java:188)
> at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(
> DataSourceProxy.java:128)
> at org.wso2.carbon.analytics.spark.core.sources.
> AnalyticsDatasourceWrapper.getConnection(AnalyticsDatasourceWrapper.
> java:72)
> at org.apache.spark.sql.jdbc.carbon.CarbonJDBCUtils$.checkAndCreateTable(
> CarbonJDBCUtils.scala:96)
> at org.apache.spark.sql.jdbc.carbon.AnalyticsJDBCRelationProvider.
> createRelation(JDBCRelation.scala:128)
> ... 27 more
> Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
> Communications link failure
>
> The last packet successfully received from the server was 514 milliseconds
> ago.  The last packet sent successfully to the server was 514 milliseconds
> ago.
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:62)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
> at com.mysql.jdbc.SQLError.createCommunicationsException(
> SQLError.java:989)
> at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(
> ExportControlled.java:164)
> at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4901)
> at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableA
> uthentication(MysqlIO.java:1659)
> at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
> at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2205)
> at com.mysql.jdbc.ConnectionImpl.connectWithRetries(
> ConnectionImpl.java:2056)
> ... 45 more
> Caused by: javax.net.ssl.SSLException: Unsupported record version
> Unknown-0.0
> at sun.security.ssl.InputRecord.checkRecordVersion(InputRecord.java:552)
> at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:565)
> at sun.security.ssl.InputRecord.read(InputRecord.java:532)
> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
> at sun.security.ssl.SSLSocketImpl.performInitialHandshake(
> SSLSocketImpl.java:1385)
> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
> at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
> at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(
> ExportControlled.java:149)
> ... 50 more
>
> JDBC connection string is in this format: jdbc:mysql://xx.rds.
> amazonaws.com:3306/database?autoReconnect=true&amp;
> relaxAutoCommit=true&amp;useSSL=true&amp;requireSSL=true
>
> I presume this is due to not matching the SSL protocols on two ends. What
> is a possible solution to overcome this?
>
> Thanks,
>
> --
> *Gayan Kaushalya Yalpathwala*
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> LK: +94 71 868 2704 <+94%2071%20868%202704>
> US: +1 650 695 2324 <(650)%20695-2324>
>
> <http://asia14.wso2con.com/>
>



-- 
Tishan Dahanayakage
Senior Software Engineer
WSO2, Inc.
Mobile:+94 716481328

Disclaimer: This communication may contain privileged or other confidential
information and is intended exclusively for the addressee/s. If you are not
the intended recipient/s, or believe that you may have received this
communication in error, please reply to the sender indicating that fact and
delete the copy you received and in addition, you should not print, copy,
re-transmit, disseminate, or otherwise use the information contained in
this communication. Internet communications cannot be guaranteed to be
timely, secure, error or virus-free. The sender does not accept liability
for any errors or omissions.
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to