Ballerina HTTP Client Rejects Self-Signed Certificates by Default: Trust Store or CA-Signed Cert?
0 reputation · 25 Nov 2025, 10:30 UTC
0 reputation · 25 Nov 2025, 10:30 UTC
Ballerina's http:Client validates TLS certificates by default, so an endpoint presenting a self-signed or otherwise untrusted certificate fails the handshake. The documented paths forward are supplying a custom trust store through the client's secure socket configuration, or having the endpoint present a CA-signed certificate. A validation-bypass mode exists but is documented as insecure and meant only for isolated testing.
Two constraints frame the choice. Exact ClientSecureSocket field names and options have varied across Swan Lake releases, so they need confirming against the installed distribution's API docs. DNS resolution is delegated to the JVM/OS resolver, and hostname verification runs inside the handshake, so a SAN mismatch surfaces as a generic SSL error that is easy to mistake for a name-resolution problem.
For a caller integrating with such an endpoint, the unresolved decision is whether to pin the self-signed certificate per client through a trust store or to move the endpoint to a CA-signed certificate.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.