Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I specific a file path to an existing SSL certificate using Java Keytool via Windows Command Prompt?

I cannot find any real world examples of how to specify a path to my existing certificate in Keytool. Only documentation that states -file "path to file". How do I enter the file path? When I run this command:
keytool -importcert -trustcacerts -keystore keystore.p12 -storetype pkcs12 -alias myAlias -file C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\SSL\my_ssl_certificate.cer

I get the error:
Illegal option: Files\Apache

Can someone please explain and provide an example of correct file path syntax? Thanks!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

First go into your jdk bin dir.

Then try again, but with the path in quotes:

keytool -importcert -trustcacerts -keystore keystore.p12 -storetype pkcs12 -alias myAlias -file “C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\SSL\my_ssl_certificate.cer”

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading