2017-07-19 11:13:36
0
I have searched quite awhile on this but have not found out a solution yet, I am currently trying to establish a connection to SQL Server
Connection con = ds.getConnection
but am getting this exception:
Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: Broken pipe ClientConnectionId:8fb783f6-2790-44e9-b459-18238edd23ff"
This is due to the driver being unable to establish a SSL connection.
I have been able to verify that I am able to ping and view the database without any issues but somehow still getting this error.
The cause as listed is:
com.microsoft.sqlserver.jdbc.SQLServerException (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: Broken pipe ClientConnectionId:8fb783f6-2790-44e9-b459-18238edd23ff"
For the same reason as above, not able to establish the SSL connection.
In context.xml I have listed:
auth="Container"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
type="javax.sql.DataSource"
maxIdle="30"
username="username"
password="password
url="jdbc:sqlserver://axpert.database.windows.net:1433;database="db";encrypt=true;trustServerCertificate=false;hostNameInCertificate="database";loginTimeout=30"
removeAbandonedTimeout="30"
logAbandoned="true" />
I am obtaining the datasource like so:
InitialContext ic = new InitialContext();
ds = (DataSource)ic.lookup("java:comp/env/jdbc/sqlazure");
So encrypt is set to true as well. I was not seeing this issue before and the only thing I can think of is that I did install Android Studio recently, not sure if this messed up the Java settings somehow ?
I am using Eclipse Oxygen June 2017, Java 1.8.0_141, Tomcat 8.5