Change default alias, mykey in HTTPS using JSSE

A

amitgupta_india

Hello everybody:

I am writing a client that talks to a server using HTTPS.

We are presently in development stage, so I have access to server's
trust store.

I created a new keypair using keytool without specifying any alias.
So, the default alias was used - mykey

I exported the certificate into a file and imported this into the
server's trust store.

Next, in my java client, I specified the location of my keystore and
identity store as follows
////////////////////////////////////////////////////////
String identityStore = "E:"+ File.separator +"Weblogic8.1"+
File.separator +"weblogic81"+ File.separator +"server"+ File.separator
+"lib"+ File.separator +"id.keystore";

String trustStore = "E:"+ File.separator +"Weblogic8.1"+ File.separator
+"weblogic81"+ File.separator +"server"+ File.separator +"lib"+
File.separator +"trust.keystore";

System.setProperty("javax.net.ssl.keyStore", identityStore);
System.setProperty("javax.net.ssl.trustStore", trustStore);
System.setProperty("javax.net.ssl.keyStorePassword", "rocket");
System.setProperty("javax.net.ssl.trustStorePassword", "socket");
////////////////////////////////////////////////////////

Everything works fine. But I want to now use a different alias, as
assuming that the certificate during the production stage would also
have mykey as alias is naive.

I am not able to figure out where to specify the name of the alias.

Any help or pointers would be greatly appreciated

Thanks

Amit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top