1

I am trying to setup Karate framework for my project. I am getting the following SSLHandshakeException for a simple GET request. I get a proper response when I try the endpoint in the browser, but when I try to run the cucumber feature file I am seeing the following error. I tried configure ssl = true, configure ssl = 'TLSv1.1', but seeing same error

10:35:28.886 [main] DEBUG 
org.apache.http.conn.ssl.LenientSslConnectionSocketFactory - Starting handshake
10:35:29.003 [main] DEBUG 
org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: Shutdown connection
10:35:29.003 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection discarded
10:35:29.003 [main] DEBUG 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}-https://hygieia*******.com:443][total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 10]
10:35:29.004 [main] ERROR com.intuit.karate - 
javax.net.ssl.SSLHandshakeException: Received fatal alert: 
handshake_failure, http call failed after 446 milliseconds for URL: 
https://hygieia******.com/api/dashboard/count
kvm006
  • 4,554
  • 2
  • 18
  • 22

2 Answers2

2

I followed the instructions for jdk8 in javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

I downloaded the mentioned jars (US_export_policy.jar, local_policy.jar) and copied them to {JAVA_HOME}/jre/lib/security and then magic happens

@Peter Thomas Thank you for your help in resolving this issue :)

kvm006
  • 4,554
  • 2
  • 18
  • 22
1

You are using version 0.6.1 right, I really thought this was fixed. Would be great if you can help me figure what change to make. Here is the ticket that will give you all the info, including code changes: https://github.com/intuit/karate/issues/193

This should work: if you are using karate-apache switch to karate-jersey (or vice-versa) in your pom.xml - most likely it will work.

Worst case, you can set System properties so that the HTTP client will use a certificate you provide, this ticket can give you some hints: https://github.com/intuit/karate/issues/76

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • 1
    Yeah. Trying on v 0.6.1 only. flipped between apache and jersey but no luck. Added this configure ssl = true and removed this but still doesn't work.What else are you looking for from our end to make it work? – Kumar112 Nov 10 '17 at 04:59
  • 1
    what I am expecting from you is a way for me to replicate this issue, thanks. if you can't, your only option is to debug the code or take someones help, based on the info I have clearly given above. – Peter Thomas Nov 10 '17 at 05:05
  • 1
    @PeterThomas thanks for your reply. Just in case, if you want to reproduce this issue, this is an open source application. Https://github.com/capitalone/Hygieia, all the instructions to set up the application are available but it might take few minutes to set it up. I will try the other alternatives you have suggested. – kvm006 Nov 10 '17 at 06:08
  • 1
    @kumarvarun - great - that is really helpful !! if you don't mind can you log a ticket at the Karate github, and also send the details of the API call you are making to make it easier. hooray for open source :) – Peter Thomas Nov 10 '17 at 06:12
  • @PeterThomas sure will do. Thanks for your time to look into this issue :) – kvm006 Nov 10 '17 at 06:17
  • @PeterThomas here is the github issue link https://github.com/intuit/karate/issues/243 – kvm006 Nov 10 '17 at 06:35