SOAP API getting error SSLHandshakeException: No trusted certificate found in Katalon

I am able to successfully execute a SOAP API request using SOAP UI, but when attempting the same in Katalon studio, encounter the following error.
=============== ROOT CAUSE =====================

Caused by: javax.net.ssl.SSLHandshakeException: No trusted certificate found

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

================================================

05-08-2025 07:15:37 PM Test Cases/API/API_TC1

Elapsed time: 20.362s

Test Cases/API/API_TC1 FAILED.

Reason:

org.codehaus.groovy.runtime.InvokerInvocationException: javax.net.ssl.SSLHandshakeException: No trusted certificate found

We have already attempted to install the certificate from the keystore in Katalon but the issue still persists. Could you please help us to identify the root cause for this problem in katalon studio. Additionally, any guidance on configuring SSL certificates correctly in Katalon would be highly appreciated

1 Like

To resolve the SSLHandshakeException: No trusted certificate found error when executing SOAP API requests in Katalon Studio, follow these steps:

1. Export the Server Certificate

Using Browser:

  1. Open the SOAP API URL in Chrome (e.g., https://your-api-endpoint).
  2. Click the padlock icon > Certificate > Details > Copy to File.
  3. Save as server-cert.cer (Base64-encoded X.509).

Using OpenSSL (Command Line):

openssl s_client -connect your-api-endpoint:443 -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM > server-cert.pem

2. Import Certificate into Katalon’s Truststore

Katalon uses the Java truststore (cacerts). Locate the JRE/Katalon’s truststore and import the certificate:

a. Find Katalon’s JRE Path

  • Go to Help > About Katalon Studio to see the JRE path (e.g., C:\Program Files\Katalon\jre).

b. Import Certificate

Use keytool (included in Katalon’s JRE bin directory):

# Windows
cd "C:\Program Files\Katalon\jre\bin"
keytool.exe -import -alias server-cert -keystore "..\lib\security\cacerts" -file "C:\path\to\server-cert.cer"

# macOS/Linux
cd /Applications/Katalon Studio.app/Contents/Eclipse/jre/bin
./keytool -import -alias server-cert -keystore ../lib/security/cacerts -file ~/path/to/server-cert.cer
  • Default truststore password: changeit
  • Confirm with yes to trust the certificate.

3. Disable SSL Verification (Temporary Workaround)

Warning: Only for non-production environments.
Add this code to your test case to bypass SSL checks:

import javax.net.ssl.*
import java.security.cert.X509Certificate

// Bypass SSL certificate validation
def allowAllCerts = [ new X509TrustManager() { 
  public X509Certificate[] getAcceptedIssuers() { null } 
  public void checkClientTrusted(X509Certificate[] certs, String authType) { } 
  public void checkServerTrusted(X509Certificate[] certs, String authType) { } 
} ] as TrustManager[]

def sslContext = SSLContext.getInstance("SSL")
sslContext.init(null, allowAllCerts, new java.security.SecureRandom())
HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory())
HttpsURLConnection.setDefaultHostnameVerifier { hostname, session -> true }

4. Configure Katalon for SSL Debugging

Add JVM args in Katalon.ini (to diagnose handshake issues):

-vmargs
... existing args ...
-Djavax.net.debug=ssl:handshake

5. Use Apache HTTPClient with Custom SSL Context

For more control, override the REST client’s SSL settings:

import org.apache.http.conn.ssl.SSLConnectionSocketFactory
import org.apache.http.conn.ssl.TrustStrategy
import org.apache.http.impl.client.HttpClients
import org.apache.http.ssl.SSLContexts

// Trust all certificates (not recommended for production)
def sslContext = SSLContexts.custom().loadTrustMaterial(null, { cert, authType -> true } as TrustStrategy).build()
def allowAllSSLSocketFactory = new SSLConnectionSocketFactory(sslContext)

def httpClient = HttpClients.custom().setSSLSocketFactory(allowAllSSLSocketFactory).build()
def response = httpClient.execute(new HttpGet("https://your-api-endpoint"))

6. Verify Corporate Proxy/Certificate

If behind a corporate proxy, import the proxy’s root CA certificate into Katalon’s truststore using Step 2.

Key Notes

  • Restart Katalon after modifying the truststore.
  • Ensure the certificate includes the full chain (root + intermediate CAs).
  • For self-signed certificates, use Step 2 or Step 3.

Troubleshooting

  • “Certificate already exists”: Delete the existing alias first:
keytool -delete -alias server-cert -keystore "path/to/cacerts"
  • Permission Denied: Run Katalon/Command Prompt as Administrator.
  • Incorrect Truststore Path: Double-check the JRE used by Katalon.

By following these steps, Katalon Studio will trust the SOAP API’s SSL certificate, resolving the handshake error

Hi Dineshh, thank you for the quick response, but unfortunately, the issue still persists. Could you please provide further guidance or if necessary, could we arrange the call, or would some one from the katalon support team connect with me to troubleshoot the issue directly on my machine.

If you are paid user, kindly submit a support ticket with katalon. they will advise on the next steps