• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Receiving: java.CertificateException: Certificate not Trusted

 
Jay Damon
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

http://content.mysite.com/public/document/0123456.txt

However, the guardians of that content have now decided to secure the content and we need to access the content via an ASP page thru a URL similar to the following:

https://content.mysite.com/service/content.asp?doc=0123456

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.
 
Set Cruz
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi -
A text search on "keystore" yielded the following thread, which may be relevant keystore discussion
 
greg stark
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic