How can I properly configure the endpoint certificate in the Ballerina client secure socket? I'm particularly interested in understanding the supported certificate formats and whether Ballerina accommodates certificate chains.
As per the documentation, it accepts a TrustStore or a cert file. But there is no information about the supported certificate formats and the support for certificate chains.
In the context of Ballerina client secure socket configuration, you can provide the endpoint certificate in either KeyStore or cert file formats.
Specifically:
For public certificates, Ballerina supports cert and pem formats.
When dealing with private keys, it's recommended to use the pkcs8 format. If your private key is currently in a different format, you can convert it to pkcs8 using the following command:
openssl pkcs8 -topk8 -nocrypt -in pkcs1_key_file -out pkcs8_key.pem
Keystores in the pkcs12 format, often denoted by a pfx extension, are also supported.
Yes, Ballerina supports certificate chains.
When configuring certificate chains: