Hi All,
Very recently we have set up https for our customers and it's working for both Smart client and webclient. But, there is a problem with Headless client, we are doing a post request for https URL at headless client using http plugin but it's not working fine, it always returns error like below,
Couldn't connect to https://xxx.com, please make sure that the ssl certificates of that site are added to the java keystore.Download the keystore in the browser and update the java cacerts file in jre/lib/security: keytool -import -file downloaded.crt -keystore cacerts
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:126)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:437)
at com.servoy.extensions.plugins.http.HttpClient$1.connectSocket(HttpClient.java:105)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at com.servoy.extensions.plugins.http.BaseRequest.executeRequest(BaseRequest.java:212)
at com.servoy.extensions.plugins.http.BaseRequest.js_executeRequest(BaseRequest.java:138)
at sun.reflect.GeneratedMethodAccessor307.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:158)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:312)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1774)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:837)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:158)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:406)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3204)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:156)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:628)
at com.servoy.j2db.plugins.ClientPluginAccessProvider$MethodExecutor.run(ClientPluginAccessProvider.java:551)
at com.servoy.j2db.server.headlessclient.SessionClient.invokeAndWait(SessionClient.java:1318)
at com.servoy.j2db.server.headlessclient.SessionClient.doInvokeLater(SessionClient.java:1308)
at com.servoy.j2db.ClientState.invokeLater(ClientState.java:1720)
at com.servoy.j2db.plugins.ClientPluginAccessProvider$1.run(ClientPluginAccessProvider.java:463)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have imported the ssl certificate to the java cacerts file but no luck. Can you please share what I have missed here.