Hi There,
I am new to this Certificate thing and running into issues! Would appreciate for all the help and please ignore for any stupid questions.
Here is my scenario.
1. I do have a client server application and client is a
java swing application which connects to a Server application (Using Jetty 4.2.22 as embedded server)
2. Initially, it had a self signed certificate but goal is to support third party certificate (i.e import in the server and then show warning to the client during login)
If somebody has already done this or point me to some example (using Jetty APIs) that would be great help. If not, here is what I am trying to do and some questions.
1. I tried to get some free SSL certificate from the web and imported into the server's KeyStore.
If I do a list from the server using Keystore, this is what it looks like
keytool -list -keystore /tmp/keystore -storepass genview
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 2 entries
self, Dec 3, 2008, PrivateKeyEntry,
Certificate fingerprint (MD5): 0D:58:E8:77:89:09:F8:2B:37:64:37:D5:03:AD:C9:0B
rapid, Jan 6, 2009, trustedCertEntry,
Certificate fingerprint (MD5): 64:9C:EF:2E:44:FC:C6:8F:52:07:D0:51:73:8F:CB:3
QUESTION 1 : why the third party certificate's entry as "trustedCertEntry"? Is it always like this? Do I need to have only one certificate at a time? (If so, just remove the self signed and have 3rd party one)
My Jetty server comes up but when I connect from Client Swing App, the "getServerCertificates()" method only returns one entry i.e self signed one but not the third party one.
I am using like this
URL url = new URL("https://127.0.0.1:port");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.connect();
Certificate[] certs = conn.getServerCertificates();
Is not this API supposed to return all the server's certificate?
Please guide me or instruct me what to do.
Thanks,
CRB