This article will include a connection\proxy configuration error followed by different offered solutions:
When running an Applitools test, you might encounter the next exception:
Exception in thread "main" javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to eyessdk.applitools.com:443 [eyessdk.applitools.com/138.91.241.141] failed: Connection timed out: connect
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:503)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:246)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:667)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:664)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:664)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:424)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:333)
at com.applitools.eyes.Jersey2xServerConnector.startSession(Jersey2xServerConnector.java:146)
at com.applitools.eyes.EyesBase.startSession(EyesBase.java:1348)
at com.applitools.eyes.EyesBase.checkWindowBase(EyesBase.java:925)
at com.applitools.eyes.Eyes.checkWindow(Eyes.java:359)
at com.applitools.eyes.Eyes.checkWindow(Eyes.java:335)
at eye.EyeTest.main(EyeTest.java:36)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to eyessdk.applitools.com:443[eyessdk.applitools.com/138.91.241.141] failed: Connection timed out: connect
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:140)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:455)
... 16 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:239)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:117)
... 25 more
Solution:
This proxy error caused by an invalid SSL Certificate, which Java doesn't allow.
Please find the following possible solutions:
1. Setting a valid SSL certificate for the proxy.
2. Adding the current proxy certificate to the Java keystore as a trusted certificate, using the following command:
keytool -import -file YOUR_PROXY_CER_FILE -alias YOUR_PROXY_NAME -keystore <path_to_jdk>\jre\lib\security\cacerts
3. Allow an access from your company to Applitools' API servers without the proxy.
Notes:You can find the full instruction for
Configuring a proxy server for Applitools Eyes SDK here.