I'm having trouble connecting via JDBC to AZURE's SQLServer database using encryption.
My connection string is as follows:
jdbc:sqlserver://servidor.database.windows.net:1433;
Database=BASE_DE_DADOS;
User=Usuario@servidor;
password=senha;
Trusted_Connection=False;
Encrypt=False;
hostNameInCertificate=*.database.windows.net;
That way it works, but if I change to Encrypt=True;
I get the following error:
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not to establish a secure connection to SQL Server using encryption SSL. Error: "java.security.cert.CertificateException: Failed to validate the name of the server in a certificate during the initialization of the Secure Sockets Layer (SSL) protocol
My version of Java is 1.8.0_91
And I'm using sqljdbc4.jar
Thank you to anyone who can assist me in resolving this issue.