First, convert your certificate in a DER format :
openssl x509 -outform der -in certificate.pem -out certificate.der
And after, import it in the keystore :
keytool -import -alias your-alias -keystore cacerts -file certificate.der
More Related Contents:
- How to build a SSLSocketFactory from PEM certificate and key without converting to keystore?
- How can I use different certificates on specific connections?
- Using a custom truststore in java as well as the default one
- Does Java support Let’s Encrypt certificates?
- java – path to trustStore – set property doesn’t work?
- How to convert certificate from PEM to JKS?
- What is Keystore?
- Using SSLContext with just a CA certificate and no keystore
- Java: Loading SSL Keystore via a resource
- Setting multiple truststore on the same JVM
- How do I list / export private keys from a keystore?
- Can we load multiple Certificates & Keys in a Key Store?
- Why does SSL handshake give ‘Could not generate DH keypair’ exception?
- Problems using Maven and SSL behind proxy
- How to read .pem file to get private and public key
- javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake during web service communicaiton
- How to find what SSL/TLS version is used in Java
- Keystore change passwords
- Keystore type: which one to use?
- java – ignore expired ssl certificate
- javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
- Using JavaMail with TLS
- CertificateException: No name matching ssl.someUrl.de found
- Java SSLHandshakeException: no cipher suites in common
- How set up Spring Boot to run HTTPS / HTTP ports
- javax.net.ssl.SSLPeerUnverifiedException: Host name does not match the certificate subject provided by the peer
- Android keystore stopped working
- SSL “Peer Not Authenticated” error with HttpClient 4.1
- How to use .key and .crt file in java that generated by openssl?
- Creating .p12 truststore with openssl