签名的小程序可以与它们所源自的不同主机连接吗?
我需要一个小程序来打开套接字并与侦听的服务器进行通信 小程序下载到的本地主机(最终用户计算机)。
与我读到的有关小程序安全性的内容相反,似乎甚至签名的小程序 无法打开到下载它们的不同主机的套接字(在同一台机器上它工作完美)
我已经使用 -selfcert 认证了小程序,使用 jarsigner 对其进行了签名,并且仍然,每当 它尝试打开到不同主机的套接字,我得到:
Java.lang.Exception:java.security.AccessControlException:访问被拒绝(java.net.SocketPermission 127.0.0.1:9999 connect,resolve)
我什至尝试更改 Java 策略文件,尽管使用签名的小程序不需要这样做:
grant codeBase "http://applethost:8080/socket" { 权限 java.security.AllPermission; 权限 java.lang.RuntimePermission "usePolicy"; sigend小
程序有什么用,它们可以连接到不同的主机吗?
I need an applet to open a socket and communicate with a server listening on
the local host to which the applet downloaded (the end user machine).
contrary to what I have read about applet security, it seems that even signed applets
cannot open a socket to a different host from which they were downloaded (on the same machine it works perfectly)
I have certified the applet using -selfcert, signed it using jarsigner, and still, whenever
it tries to open a socket to a different host, I get:
Java.lang.Exception: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:9999 connect,resolve)
I even tried changing the Java policy file, although with signed applets it is not required to do so:
grant codeBase "http://applethost:8080/socket" {
permission java.security.AllPermission;
permission java.lang.RuntimePermission "usePolicy";
};
What is the deal with sigend applets, can they connet to a different host or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,当你加载你的小程序时,如果你选择接受它的证书并信任它,它就会被授予AllPermission,其中包括SocketPermission。 我之前编写了一个签名的小程序,它连接到加载它的主机以外的主机。 您可以尝试暂时更改您的 java 策略文件,以便
Yes, when you load your applet, if you choose to accept its certificate and trust it, it is granted AllPermission, which includes SocketPermission. I have written a signed applet before that connects to a host other than the one from which it was loaded. You could try temporarily changing your java policy file to just have