I am using Gatling to Test Rest APIs… it requires CA certificate. i am able to get the proper response using standalone Gatling after updating the Conf file with ‘Keystore’ location.
But when i am trying with the Gatling with Gradle integration through Intellij IDEA, i am facing Unauthorized Issue (HTTP - 401).
Exact error :
“error”:“invalid_client”,
“error_description”:“SSL with client authentication is required”
i am pretty sure, this is due to certificate.
i have tried importing the certificate in different formats (.key /.pem/ .jks), added to Java -cacerts, gradle.properties…etc
Official Gatling Gradle plugin was released this week. Do you use it for your project?
Which version of Gatling do you use?
Can you provide an SSCCE as required by this mailing list?
Provide aShort, Self Contained, Correct (Compilable), Example (seehttp://sscce.org/)
My first guess is about the path to the certificate. Where the certificate lies, what is the configuration used?
Is the path in resources defined in gradle?
we need to add the CA certificate (keystore) file path to gatling.conf and try adding Truststore to java cacerts (jdk/jre/lib/security/cacerts) using java Keytool Import.
if you are trying to build a gradle project on your own, try adding the Gatling version you are using as dependency in build.gradle file
i have used ‘gatling-gradle-plugin-demo-master’ project (you can find it here - https://github.com/gatling/gatling-gradle-plugin-demo), and updated gatling.conf file with keystore details before building it. it worked out for me.