A friend of mine is trying using JavaMail over a secure socket (he simply used SSLSocketFactory instead of the non-secure one). Here's the catch, the certificate used by the server to which he is connecting is self signed, so it doesn't chain back to Verisign or Thawte. The scoket throws an exception because it doesn't accept the certificate. When I use Netscape, or similar programs, the software warns me that it doesn't recognize the certificate, but will allow me to accept it, and thereby add it to my KeyStore (or rather the Netscape equivalent). How can I do this in Java? It would be a pain to have to really get down into the guts of the SSL implementation.