Enforcing a specific certificate
I am trying to establish a secure connection with a remote machine and I wish to ensure that I am connected to the machine I expect by validating its certificate. All of this with the purpose of using JavaMail to send an email via smtp on this secure connection.
My problem here is that I can't figure out how to validate a specific certificate. I have tried using a custom KeyStore so that only one certificate would be accepted instead of resolving the trusted Certificate Authorities. But by doing so, I had to implement a custom SSLSocketFactory which doesn't seem to be possible with Java 1.4.2 because of the non backward compatible changes that occured on java.net.Socket.
Any suggestions, code samples or URLs to tutorials would be very appreciated.
Thanks
PS: I have already consulted the following documents while trying to solve this problem:
http://java.sys-con.com/read/216388.htm
http://www.javaworld.com/javatips/jw-javatip115.html
Message was edited by:
Dalzhim

