2

I have an existing project using karate-junit5:1.1.0 to test an API. When ran locally from my laptop everything is working as expected. I'm implementing the same test in Jenkins and we need to use a proxy server to connect to external URLs from our Jenkins nodes.

Prior to updating the test to use a proxy I get an error like this attempting to connect to the external URL:

15:17:46.486 [pool-1-thread-4] ERROR com.intuit.karate - karate.org.apache.http.conn.ConnectTimeoutException: Connect to <url redacted>:443 [<url redacted>] failed: connect timed out, http call failed after 30198 milliseconds for url: https://<url redacted>
15:17:46.488 [pool-1-thread-4] ERROR com.intuit.karate - classpath:token/GetAuthToken.feature:16

Using the karate documentation I updated the project to use a proxy globally in the karate-config.js file: karate.configure('proxy', 'http://<url redacted>');

After making this change, I am now seeing a different error when the test attempts to connect to the external URL:

12:38:57.391 [pool-1-thread-1] ERROR com.intuit.karate - javax.net.ssl.SSLHandshakeException: Received fatal alert: unrecognized_name, http call failed after 1514 milliseconds for url: https://<url redacted>
12:38:57.392 [pool-1-thread-1] ERROR com.intuit.karate - classpath:token/GetAuthToken.feature:16

In searching online I couldn't find much information about this new error. Any idea on how I can resolve this so I can run my tests in external facing environments? Thanks

brian
  • 43
  • 4
  • this sounds like something you have to solve on your own and work with your network / ops folks. look out for any HTTPS related problems: https://stackoverflow.com/search?q=%5Bkarate%5D+proxy also see: https://stackoverflow.com/a/55359395/143475 – Peter Thomas Sep 09 '21 at 19:57
  • 1
    Thank you for the info. I found a work-around for the time being. I updated my jenkins pipeline script to pass in this parameter: `-Djsse.enableSNIExtension=false` Which appears to have gotten around the issue and my tests are running – brian Sep 09 '21 at 21:34

0 Answers0