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
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