Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocketException Despite Successful SSL Handshake in Karate #2650

Open
nitsb opened this issue Feb 4, 2025 · 0 comments
Open

SocketException Despite Successful SSL Handshake in Karate #2650

nitsb opened this issue Feb 4, 2025 · 0 comments

Comments

@nitsb
Copy link

nitsb commented Feb 4, 2025

I am using Karate to test an API over HTTPS and have configured SSL with a custom trust store. The handshake between the client and server appears to be successful, but I am still encountering the following error:

java.net.SocketException: An established connection was aborted by the software in your host machine

Karate Configuration:

karate.configure('ssl', { trustAll: true });
karate.configure('ssl', {
keyStore: 'mykeystore.pfx',
keyStorePassword: 'changeit',
keyStoreType: 'pkcs12',
trustStore: 'cacerts',
trustStorePassword: 'changeit',
algorithm: 'TLSv1.2'
});
karate.configure('connectTimeout', 15000);
karate.configure('readTimeout', 15000);

I have added the server certificate to my trust store (.pem format) and updated the Karate configuration accordingly. The SSL handshake seems to be happening, but I still receive a SocketException when making a request.

What I Have Tried:
1. Verified that the server certificate is correctly added to the trust store.
2. Used trustAll: true to bypass certificate validation (still getting the error).
3. Checked the server logs, but no clear reason for the aborted connection.
4. Increased connectTimeout and readTimeout.

Questions:
• Is there anything missing in my Karate SSL configuration that could cause this issue?
• Are there any additional debugging steps I can take to diagnose why the connection is being aborted after the handshake?

Any guidance would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant