可签名的Applet与其所产生不同的主机连接? [英] Can signed applets connect with a different host from which they originate?

查看:216
本文介绍了可签名的Applet与其所产生不同的主机连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个小程序打开一个套接字和服务器监听通信
本地主机到小程序下载(最终用户的机器)。

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).

相反,我所了解的小程序的安全性,似乎连签名applet
无法打开一个套接字从他们被下载的(它完美的作品在同一台机器上)不同的主机

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)

我已经使用认证的-selfcert小程序,签署了使用的jarsigner,依然,每当
它试图打开一个套接字到不同的主机,我得到:

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:访问被拒绝(java.net.SocketPermission 127.0.0.1:9999连接,解决)

我甚至尝试修改Java策略文件,虽然与签名的Applet,它不这样做必需的:

I even tried changing the Java policy file, although with signed applets it is not required to do so:

拨款codeBase的HTTP:// applethost:8080 /插座{
    权限java.security.AllPermission;
    许可java.lang.RuntimePermissionusePolicy
};

什么是sigend小程序的交易,他们可以选择Connet到其他主机或不?

What is the deal with sigend applets, can they connet to a different host or not?

推荐答案

是的,当你加载你的小程序,如果您选择接受其证书和信任它,它被授予的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

grant {
  permission java.security.AllPermission;
};


  • 查找策略文件,看它是否定义了任何其他policy.url位置,也许他们的干扰。

  • 检查JavaScript的浏览器设置可能。

  • 请确保您接受了证书的小程序,它被安装到你的站点证书的列表。

  • 请确保您有拨款codeBase的线是相同applet的清单中的codeBase的。

  • 您可以尝试打印出你的小程序有你尝试连接之前的权限列表。

  • 您可以尝试以编程方式从applet中给予的AllPermission。

  • 这篇关于可签名的Applet与其所产生不同的主机连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆