自簽名Applet即使已簽名,仍可能彈出安全警告。可嘗試以下流程,將憑證加入本機Java信任庫,並調整Java安全設定。
使用keytool產生keystore與cer憑證:
keytool -genkey -keystore hp.keystore -alias hp -validity 3650keytool -export -keystore hp.keystore -alias hp -file hp.cerjarsigner -keystore hp.keystore xxxApplet.jar hp開啟Java控制台,將安全級別設為「中」,並在Manage Site List加入伺服器位址。
找到JRE路徑,進入jre/lib/security,將cert複製到該目錄,再執行:
keytool -import -alias hp -keystore cacerts -file hp.cer提示輸入密碼時,可使用cacerts預設密碼changeit。
完成後可在Java控制台看到憑證,重新執行Applet,應該不再彈出警告。