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:

<Resource name="jdbc/sqlazure"
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

1 Answer 1

1

For those who may have seen the same issue, I was able to resolve this by upgrading the SDK to 1.8.0_141 and pointing Eclipse to use the new JRE environment. I made the mistake of leaving Eclipse pointing to the old JRE environment.

However, it was working before I updated the JDK to 1.8.0_141 from 1.8.0_77, am not sure yet what differences there are between the versions, or if there was some updates on the Azure end that required an update to at least version 1.8.0_141. Any insights on this would be interesting to hear

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.