java sqlserver ssl_JDBC SQL Server无法建立SSL连接 (JDBC SQL Server Unable to Establish SSL Connection)...

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值