java - Adding an SSL Certificate to JRE in order to access HTTPS sites -


context:

so i'm trying access https site java code not able due ssl handshake issues between localhost , server. seems reason issues url trying access has no valid certificate issued authorized ca.

so after research, i'm going try import offending ssl certificates jre, way can validated.

question:

what mac equivalent of command using keytool importing certificates:

keytool -import -alias mycertificate -keystore ..\lib\security\cacerts -file c:\mycert.cer 

reference:

http://www.jyothis.co.in/2011/11/12/javax-net-ssl-sslhandshakeexception/

any or assistance appreciated, thank you

you should able import server (self-signed?) ssl certificate onto localhost using command specified. more complete, can try

$java_home/bin/keytool -import -alias mycertificate -keystore path_to_keystore -file certificate_file  

where

  • $java_home on mac /system/library/frameworks/javavm.framework/home/
  • path_to_key_sotre $java_home/lib/security/cacerts
  • certificate_file store downloaded certificate

if prompted, default truststore password changeit.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -