https

阅读更多
keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts"  -file dynamic.12306.cn.crt

输入keystore密码:changeit


		String image = "https://dynamic.12306.cn/otsweb/passCodeAction.do?rand=lrand&"+Math.random();
		System.out.println(image);
		URL httpURL = new URL(image); 
		HttpsURLConnection connection = (HttpsURLConnection)httpURL.openConnection();






1.windows
keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts"  -file icity.cer
输入keystore密码:changeit

windows
2.在C:\WINDOWS\system32\drivers\etc\hosts文件中加入
192.168.29.36 icity.china.com
--------------------------------------------------------------------------------
1.linux
keytool -import -keystore "$JAVA_HOME/jre/lib/security/cacerts"  -file icity.cer
输入keystore密码:changeit

2.在/etc/hosts文件中加入如
192.168.29.36   icity.china.com service2


你可能感兴趣的:(security,keystore,keytool)