I need to integrate java service with go app, which can be configured to specify the CA certificate file to use when checking TLS. I'm not familiar with go. The Java rest endpoint is secured with self-signed certificate.
I'm trying to export it using keytool like this:
keytool -export -alias rootca -file ca.crt -keystore cacerts
The ca.crt file is checkable with keytool itself with command:
keytool -printcert -v -file ca.crt
Now when I try to use this file in go app, which is prometheus by passing tls_config with ca_cert value pointing to exported file I get an error:
err="error creating HTTP client: unable to use specified CA cert /etc/prometheus/ssl/ca.crt"
The Prometheus is using the the go's standart crypto/tls so my questions is:
- Is the way I exported Java file is correct and usable?
- How can I translate exported Java CA file to the format that Go will understand and use?