The driver cannot establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

Source: Internet
Author: User

Because JDK6 must be used as a Java environment in the project, there was a com.microsoft.sqlserver.jdbc.SQLServerException when connecting to SQL Server: The driver failed to use Secure Sockets Layer (SSL) Encryption establishes a secure connection with SQL Server. Error: "Java.lang.RuntimeException:Could not generate DH keypair". Such a mistake.

This is fixed in the JDK7, so if the project allows to be replaced with JDK7 bar, but some can only use JDK6 project encountered this situation to do?

This problem also occurs when the JDK7 is actually used.

The first step:

Download two jar packages--------------------->bcprov-ext-jdk15on-1.54.jar and Bcprov-jdk15on-1.54.jar

Click to download the jar package

Step Two: Copy the downloaded two jar files to the following: JDK installation directory \jre\lib\ext, for example, mine is F:\JDK\jdk6\jre\lib\ext

Open the Java.security file: Java.security file under JDK installation directory \jre\lib\security.

Find Security.provider.1=sun.security.provider.sun and replace it.

Security.provider.1=org.bouncycastle.jce.provider.bouncycastleprovider

Re-execute the connected database program to

Original address : http://www.cnblogs.com/shuilangyizu/p/6003858.html

The driver cannot establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.