11### Importing common root certificates
22
3- Java's default trust store does not include root certificates from a number of popular certificate authorities . This
4- means that connections to servers which make use of certificates signed by CAs such as StartCom (e.g. EsperNet) will
3+ Java's default trust store may not include the certificate authority (such as self-signed) used by your IRC . This
4+ means that connections to servers which make use of certificates signed by these CAs will
55fail.
66
77It's possible to manually import the root certificates into Java's trust store which will make such connections work.
88This approach is preferable to making use of the ` InsecureTrustManagerFactory ` or otherwise disabling certificate
99verification.
1010
11- 1 . Download the root certificates in DER form. For StartCom's roots, these can be obtained using wget:
11+ 1 . Download the certificate in DER form.
1212
1313``` sh
14- wget https://www.startssl.com/certs/der/ca.crt https://www.startssl.com/certs/der/ca-g2.crt
15- ```
16-
17- If the certificates you want to import aren't available in DER form, you can convert one in PEM form using:
18-
19- ``` sh
20- openssl x509 -in certificate.crt -out certificate.der -outform DER
14+ openssl s_client -showcerts -connect irc.host:6697 < /dev/null | openssl x509 -outform DER > cert.der
2115```
2216
23171 . Locate the ` cacerts ` file. This is located in the ` lib ` of the JAVA_HOME directory. For example,
@@ -28,7 +22,7 @@ which is set by default to 'changeit'. If you've not changed it, you should be a
2822supply an alias for each certificate via the ` -alias ` argument.
2923
3024``` sh
31- sudo keytool -trustcacerts -keystore /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts -noprompt -importcert -alias StartCom1 -file ca.crt
25+ sudo keytool -trustcacerts -keystore /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts -noprompt -importcert -alias irchost -file cert.der
3226```
3327
3428You can list all certificates in your trust store and verify the certificates were correctly added by issuing
0 commit comments