The application I am working contains a class that is used to include text content from another site. It does this by 1) creating a URL object, 2) opening a URLConnection and 3) reading the content via an InputStream. This code has worked fine up to now for URLs such as:
and this breaks the web page content retrieval class with the exception:
javax.SSLHandshakeException: java.CertificateException: Certificate not Trusted
The problem appears to be one of authentication but I am unsure how authentication should be performed via the URL / URLConnection objects currently being accessed. I do not see anything in the Javadoc that appears to address this problem.
Note: The code does have access to a valid user id / password at the time of retrieval.
Any suggestions as to how to proceed would be appreciated.
Also note that the JSSE uses the terminology "truststore" to refer to the store that contains certificates that you want to trust. A keystore can contain trusted certificates and also your own secret and private keys. The JSSE docs (http://java.sun.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html) contain much information on various ways to customize your truststore, including something as simple as putting the trusted certificates in a file and setting a system property to point to this file.