Configure custom truststore

Hello Gatling Community,

I recently upgraded both Gatling to version 3.12.0 and Java to version 22 in my project, but I’m encountering a recurring issue, which seems to be related to the compatibility between these versions.

Issue Description:

After upgrading to Java 22 and Gatling 3.12.0, the build fails with the following error during execution:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

It appears that there is a certificate validation issue (PKIX path building failed), but the same setup works fine when I roll back to Java 21. I suspect that this issue may stem from Java 22 being experimental or certain libraries not being fully compatible with this version of Java yet.

What I Have Tried:

  1. Reverted to Java 21 with Gatling 3.12.0, and the error no longer occurs.

  2. Checked the JDK trust store to ensure there are no missing certificates.

  3. Added SSL debugging, but the issue persists when using Java 22.

  4. Temporarily disabled SSL validation (not ideal), which bypasses the error but isn’t a long-term solution.

Questions:

• Is Gatling 3.12.0 officially compatible with Java 22, or are there any known limitations or upcoming updates to support this version?

• Has anyone successfully run Gatling with Java 22, and if so, are there any workarounds or configurations that need to be applied?

Any insights or suggestions would be greatly appreciated! I am eager to understand whether this is purely a compatibility issue or if there are specific adjustments I can make in my setup.

Thanks in advance for your support!

System Details:

Gatling Version: 3.12.0

Java Version: 22

OS: macOS

It’s utterly impossible it’s a compatibility issue between your Java version and Gatling.
Gatling doesn’t do anything fancy there and just uses plain Java for loading truststores and keystores.

Similarly, I highly doubt this could be a regression in Java 22.

I’m 100% sure the cert missing from your truststore. You probably want to verify your step 2.

Hello everyone,

I wanted to share an update regarding a recent issue I faced while working with Gatling. Initially, I encountered a certificate problem, which I was concerned might be related to compatibility issues. However, I was able to resolve the certificate issue without it being a compatibility problem.

To fix the certificate issue, I followed these steps:

  1. Check the SSL/TLS Configuration: I ensured that my SSL certificates were correctly configured and accessible to the Gatling application.

  2. Update Java’s Truststore: I imported the necessary certificates into Java’s truststore using the following command:

keytool -import -alias mycert -file path/to/mycert.crt -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit

  1. Restart Gatling: After updating the truststore, I restarted the Gatling application to apply the changes.

I hope this helps anyone facing similar issues!

Best regards,
Natalia

FYI, I’ve cleaned up and closed your thread as:

  • its title was unrelated about what your actual problem was
  • your last message was about a completely unrelated topic

It’s best to keep threads focused on one topic with a clear title so it can help other community members.

Regards