My task is to retrieve emails from an imaps email server using Java so as a client I need to authenticate the email server using an appropriate certificate. It seems however, that this email server is using a self-signed certificate which does not included in the truststore(?) by default. From what I found here, the system properties javax.net.ssl.trustStore
and javax.net.ssl.trustStorePassword
need to be set. The example is given:
System.setProperty("javax.net.ssl.trustStore","clientTrustStore.key");
System.setProperty("javax.net.ssl.trustStorePassword","qwerty");
My question is how do I obtain this clientTrustStore.key
and the related password? Is that something I can generate myself given I know the email server details or is that something that should be provided by the IT department who maintains this email server?