Please do this:
* configure ssl = true
Read the docs for more: https://github.com/intuit/karate#configure
EDIT: for those landing here in the future (and on Karate version < 1.0), I recently realized that if the above fails, it is most likely that you have added Karate to a Java Maven (or Gradle) project that has a different version of the Apache HTTP Client libraries in scope. And what happens is that the JAR conflict causes some SSL related classes to fail to load.
There are 2 solutions:
- use
karate-jersey
instead ofkarate-apache
- force the version of the Apache dependencies like this:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${apache.version}</version>
</dependency>
The value of apache.version
depends on what your project needs and what Karate depends on, and in most cases, using the latest possible version would work.