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