java.security.NoSuchAlgorithmException: SunTlsMasterSecret KeyGenerator not available"

Solution Verified - Updated -

Issue

I am getting an exception trying to connect to a SQLServer database.

INFO   | jvm 1    | 2017/07/12 11:08:16 | Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "java.security.ProviderException: java.security.NoSuchAlgorithmException: SunTlsMasterSecret KeyGenerator not available". ClientConnectionId:8c9f7ef4-154e-4735-86a7-29c41333ff79
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2397)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1762)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1977)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1628)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1459)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:773)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1168)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:39)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:205)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2162)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2148)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   ... 22 more
INFO   | jvm 1    | 2017/07/12 11:08:16 | Caused by: javax.net.ssl.SSLException: java.security.ProviderException: java.security.NoSuchAlgorithmException: SunTlsMasterSecret KeyGenerator not available
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1842)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1825)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1346)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1688)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   ... 31 more
INFO   | jvm 1    | 2017/07/12 11:08:16 | Caused by: java.security.ProviderException: java.security.NoSuchAlgorithmException: SunTlsMasterSecret KeyGenerator not available
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.Handshaker.calculateMasterSecret(Handshaker.java:1064)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.Handshaker.calculateKeys(Handshaker.java:999)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:944)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:285)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   ... 33 more
INFO   | jvm 1    | 2017/07/12 11:08:16 | Caused by: java.security.NoSuchAlgorithmException: SunTlsMasterSecret KeyGenerator not available
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at javax.crypto.KeyGenerator.<init>(KeyGenerator.java:158)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:207)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.JsseJce.getKeyGenerator(JsseJce.java:267)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   at sun.security.ssl.Handshaker.calculateMasterSecret(Handshaker.java:1051)
INFO   | jvm 1    | 2017/07/12 11:08:16 |   ... 41 more

Environment

  • Red Hat JBoss Fuse 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.