Reputation: 79
i have a problem with my application: i must integrate a request to Amazon EC2 in a flow that use an own SSL connection. So to launch my application i must use this command:
java -cp . -Djavax.net.ssl.keyStore=config/serverkeys -Djavax.net.ssl.keyStorePassword=mypass -Djavax.net.ssl.trustStore=config/serverkeys -Djavax.net.ssl.trustStorePassword=mypass -jar app.jar
but Amazon EC2 answer with : Unable to execute HTTP request: peer not authenticated
If i remove the trusstore part, so i use only java -cp . -Djavax.net.ssl.keyStore=config/serverkeys -Djavax.net.ssl.keyStorePassword=mypass, everything goes well. It seems that i need an Amazon EC2 certificate in my trusstore...
Anyone has good idea about this? Thanks, Sorry for my english
Upvotes: 3
Views: 5969
Reputation: 310840
You shouldn't use the same file for both keystore and truststore. You need a private key and a certificate that Amazon will trust in your keystore. Your truststore contains public certificates that you trust, i.e. Amazon's in this case, and this is what you presently don't have, hence the error. If the SSL server uses a CA-signed certificate, you don't need your own truststore at all, the default one that comes with the JRE will do.
Upvotes: 2