Java 1.8.0 enable TLS1.2 in JDBC connection

前端 未结 2 455
死守一世寂寞
死守一世寂寞 2021-01-14 04:44

I have an SQL Server 2014 updated to the latest fixpack (12.0.5207). In the environment, the only protocol enabled is TLS1.2 (the registry keys has been set

相关标签:
2条回答
  • 2021-01-14 04:48

    Older versions of Microsoft's JDBC driver for SQL Server apparently assume that TLS v1.1 will be available on the server. That is, they were not coded to handle the case where the server explicitly rejects (or ignores) TLS v1.1 traffic.

    Starting with JDBC driver version 6.3.2 we can add ;sslProtocol=TLSv1.2 to our connection URLs to specify the TLS version to use.

    0 讨论(0)
  • 2021-01-14 04:49

    The latest version of the driver fixed this issue for me. Version downloaded from here https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15 and used in JBoss 7.2 server. With this version I did not need to add anything to my connection URL. I had to modify my module.xml for the new file name but did not need to alter the dependencies section. I was getting the same response and this resolved it. I did not add any -D JVM options like the OP mentions.

    *** ClientHello, TLSv1 ... main, WRITE: TLSv1 Handshake ... main, called close() main, called closeInternal(true) main, SEND TLSv1.2 ALERT: warning, description = close_notify main, WRITE: TLSv1.2 Alert, length = 2

    0 讨论(0)
提交回复
热议问题