Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-858

Properties parameter different than string not taken in account

    XMLWordPrintable

    Details

      Description

      The published doc https://mariadb.com/products/skysql/docs/clients/mariadb-connector-j-for-skysql-services/ has the code snippet where it shows:

      connProperties.put("user", "db_user");
      connProperties.put("password", "db_password");
      connProperties.put("useSSL", true);
      connProperties.put("serverSslCert", "/path/to/skysql_chain.pem");

      The value for the useSSL parameter isn't in quotes. This generates a bad handshake error:

      java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=henry-xpand-ssl.mdb0001358.db.skysql.net)(port=5001)(type=master) : (conn=110) Bad SSL handshake
      at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
      at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:192)
      at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1372)
      at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:635)
      at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:150)
      at org.mariadb.jdbc.Driver.connect(Driver.java:89)
      at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
      at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:189)
      at doc.main(doc.java:21)
      Caused by: java.sql.SQLNonTransientConnectionException: (conn=110) Bad SSL handshake
      at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
      at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:187)
      at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authenticationHandler(AbstractConnectProtocol.java:769)
      at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.createConnection(AbstractConnectProtocol.java:546)
      at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1367)
      ... 6 more

      When the value is in double-quotes, the JDBC connection works.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              diego dupin Diego Dupin
              Reporter:
              henry.hwang@mariadb.com Henry Hwang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration