javax.net.ssl.SSLHandshakeException

General SSLEngine problem

Samebug tips2

Set the 'mail.smtp.ssl.trust' system property to an smtp host, like 'smtp.gmail.com'.

If you're using wiremock, configure your code to accept wiremock self-signed certificate or create a keystore and certificate that are trusted by your HTTP client and configure wiremock to use that

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web317

  • General SSLEngine problem
  • via GitHub by dennusb
    , 1 year ago
    General SSLEngine problem
  • General SSLEngine problem
  • Stack trace

    • javax.net.ssl.SSLHandshakeException: General SSLEngine problem at com.sun.net.ssl.internal.ssl.Handshaker.checkThrown(Handshaker.java:1015) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:485) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.java:1128) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:1100) at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:452) at weblogic.security.SSL.jsseadapter.JaSSLEngine$1.run(JaSSLEngine.java:68) at weblogic.security.SSL.jsseadapter.JaSSLEngine.doAction(JaSSLEngine.java:732) at weblogic.security.SSL.jsseadapter.JaSSLEngine.wrap(JaSSLEngine.java:66) at weblogic.socket.JSSEFilterImpl.wrapAndWrite(JSSEFilterImpl.java:619) at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:91) at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:64) at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:59) at weblogic.socket.JSSEFilterImpl.write(JSSEFilterImpl.java:390) at weblogic.socket.JSSESocket$JSSEOutputStream.write(JSSESocket.java:78) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at java.io.FilterOutputStream.flush(FilterOutputStream.java:123) at weblogic.net.http.HttpURLConnection.writeRequests(HttpURLConnection.java:186) at weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:280) at cn.jpush.api.common.connection.NativeHttpClient._doRequest(NativeHttpClient.java:153) at cn.jpush.api.common.connection.NativeHttpClient.doRequest(NativeHttpClient.java:93) at cn.jpush.api.common.connection.NativeHttpClient.sendPost(NativeHttpClient.java:80) at cn.jpush.api.push.PushClient.sendPush(PushClient.java:119) at cn.jpush.api.JPushClient.sendMessageAll(JPushClient.java:362) at cn.liucy.hello.HelloPush.doPost(HelloPush.java:40) at cn.liucy.hello.HelloPush.doGet(HelloPush.java:29) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174) at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1528) at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:243) at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235) at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1206) at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:136) at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593) at com.sun.net.ssl.internal.ssl.Handshaker$1.run(Handshaker.java:533) at java.security.AccessController.doPrivileged(Native Method) at com.sun.net.ssl.internal.ssl.Handshaker$DelegatedTask.run(Handshaker.java:952) at weblogic.socket.JSSEFilterImpl.doTasks(JSSEFilterImpl.java:186) at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:95) ... 31 more Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:323) at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:217) at sun.security.validator.Validator.validate(Validator.java:218) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209) at weblogic.security.SSL.jsseadapter.JaTrustManager.checkServerTrusted(JaTrustManager.java:125) at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1198) ... 38 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174) at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318) ... 44 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 11 months ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    25 times, 4 weeks ago
    Unknown user
    Once, 4 weeks ago
    61 more bugmates