我在新的网络服务器上部署签名的小程序(来自受信任的 CA 的证书)时遇到问题。它在我的旧网络服务器上运行良好,但是当我将它传输到新主机时,它被 Java 安全设置阻止。
我在我的 html 文件中像这样部署它:
<div id="applet">
<script>
var attributes = {codebase:'http://ab123.wwwdns.example.com/Applet/',
code: 'db.main.ExApplet',
archive: 'ExampleApplet.jar',
width: '1150',
height: '700',
permissions: 'sandbox'};
var parameters = {};
var version = '1.6';
deployJava.runApplet(attributes, parameters, version);
</script>
</div>
我的清单文件包含以下几行:
Manifest-Version: 1.0
Application-Name: Example Name
Permissions: sandbox
Caller-Allowable-Codebase: *.example.com http://ab123.wwwdns.example.com http://other.example.com
Codebase: *.example.com http://ab123.wwwdns.example.com http://other.example.com
Application-Library-Allowable-Codebase: *.example.com http://ab123.wwwdns.example.com http://other.example.com
Entry-Point: db.main.ExApplet
(以前我尝试过只指定 *.example.com 但这也不起作用)
我猜这个问题与小程序现在可以通过两个不同的 URL(ab123.wwwdns.example.com 和 other.example.com)访问这一事实有关吗?
以下是 Java 控制台的摘录(Firefox 上的 Java 8 Update 71 build 15 Plugin):
java.lang.reflect.InvocationTargetException
...
Caused by: com.sun.deploy.security.BlockedException: Your security settings have blocked an untrusted application from running
at com.sun.deploy.security.BlockedDialog.show(Unknown Source)
at com.sun.deploy.security.SandboxSecurity.checkRunUntrusted(Unknown Source)
at
com.sun.deploy.security.SandboxSecurity.checkUnsignedSandboxSecurity(Unknown Source)
...
欢迎任何提示!