0

I am trying to make a JDBC connection to SQL server but I am getting this error Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server did not return a response. The connection has been closed. ClientConnectionId:ed21ad88-5a8b-47fc-837e-e93b3caf2fca".)

using SSMS (SQL server 18) using java version "18.0.1.1"

I checked in related content in stackoverflow but still no use SQL Server JDBC Error on Java 8: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

enter image description here enter image description here

1 Answers1

0

It looks like there is a problem with SSL handshake between the JDBC driver and MSSQL database, you can enable SSL debugging by adding the next line to system.properties file (lives in "bin" folder of your JMeter installation)

javax.net.debug=all

As a workaround you can add encrypt=false parameter to your JDBC URL so the connection would be plaintext, the error should go away, however if you're testing the database your setup should be as close to the production as possible so I would rather recommend checking out what's going on with the secure communications.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks @dmitri , Issue is resolved when I follow this jdbc:sqlserver://XXX:1433;instanceName=XXXX;DatabaseName=XXXX;encrypt=true;trustServerCertificate=true;sslProtocol=TLSv1.2 but now I get this error - java.sql.SQLException: Cannot create PoolableConnectionFactory – Ram Raj Oct 06 '22 at 12:28