title: javax.net.ssl.SSLHandshakeException: Even after adding certificate
body: <p>I am using weblogic server which has keystores in use like :</p>
  <p><a href="https://i.stack.imgur.com/sanKT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sanKT.png" alt="enter image description here" /></a></p>
  <p>Now when my application running on this server tries to download images from another server, it throws
  <code>javax.net.ssl.SSLHandshakeException: General SSLEngine problem</code></p>
  <p>I have added server certificates to these both <code>DemoTrust.jks</code> and <code>JDK CACERTS</code> using <a href="http://saltnlight5.blogspot.com/2016/07/wls-how-to-import-ssl-cert-into-wls.html" rel="nofollow noreferrer">this link</a> :
  after adding certificates, it looks like :</p>
  <p><a href="https://i.stack.imgur.com/IN8E9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IN8E9.png" alt="enter image description here" /></a></p>
  <p>And java certs has</p>
  <p><a href="https://i.stack.imgur.com/wv9nY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wv9nY.png" alt="enter image description here" /></a></p>
  <p>As suggested by different posts, I have also added to startWeblogic.cmd</p>
  <blockquote>
  <p>set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.security.SSL.verbose=true
  set JAVA_OPTIONS=%JAVA_OPTIONS% -Dweblogic.security.SSL.enable.renegotiation=true
  set JAVA_OPTIONS=%JAVA_OPTIONS% -Dsun.security.ssl.allowUnsafeRenegotiation=true</p>
  </blockquote>
  <p>Am I missing something ? Any Suggestions ?</p>
  <p>Edit 1 : Adding exception stacktrace</p>
  <blockquote>
  <p>vax.net.ssl.SSLHandshakeException: General SSLEngine problem
  at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1529)
  at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:535)
  at sun.security.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.java:1214)
  at sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:1186)
  at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:469)
  at weblogic.security.SSL.jsseadapter.JaSSLEngine$1.run(JaSSLEngine.java:69)
  at weblogic.security.SSL.jsseadapter.JaSSLEngine.doAction(JaSSLEngine.java:743)
  at weblogic.security.SSL.jsseadapter.JaSSLEngine.wrap(JaSSLEngine.java:67)
  at weblogic.socket.JSSEFilterImpl.wrapAndWrite(JSSEFilterImpl.java:771)
  at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:119)
  at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:87)
  at weblogic.socket.JSSESocket.startHandshake(JSSESocket.java:250)
  at weblogic.net.http.HttpsClient.New(HttpsClient.java:577)
  at weblogic.net.http.HttpsClient.New(HttpsClient.java:557)
  at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:265)
  at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:651)
  at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:628)
  at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:260)
  at org.jsoup.helper.HttpConnection.get(HttpConnection.java:249)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
  at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
  at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
  at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:101)
  at com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:101)
  at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at com.oracle.pitchfork.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:101)
  at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
  at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
  at sun.reflect.GeneratedMethodAccessor235.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.oracle.pitchfork.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:94)
  at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
  at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
  at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
  at com.sun.proxy.$Proxy254.execute(Unknown Source)
  at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:33)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)
  Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
  at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
  at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1728)
  at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:330)
  at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:322)
  at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1614)
  at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
  at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
  at sun.security.ssl.Handshaker$1.run(Handshaker.java:992)
  at sun.security.ssl.Handshaker$1.run(Handshaker.java:989)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1467)
  at weblogic.socket.JSSEFilterImpl.doTasks(JSSEFilterImpl.java:223)
  at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:123)
  ... 44 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:397)
  at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:302)
  at sun.security.validator.Validator.validate(Validator.java:260)
  at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
  at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
  at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:105)
  at weblogic.security.SSL.jsseadapter.JaTrustManager.checkServerTrusted(JaTrustManager.java:128)
  at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:999)
  at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1601)
  ... 52 more
  Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
  at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
  at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
  at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:392)
  ... 60 more</p>
  </blockquote>