Java小程序涉及磁盘读取的应用程序安全警告

发布于 2024-09-25 03:54:53 字数 241 浏览 1 评论 0原文

我有一个java小程序,当用户访问网页时,它会下载到用户的浏览器,并允许他们将可恢复的文件上传到我的服务器。显然,这需要小程序访问用户的硬盘,据我所知,这超出了小程序可以运行的常规沙箱范围。用户会看到一个安全警告弹出窗口,要求他们允许该小程序运行。

我已经使用 verisign 对小程序进行了签名,并且获取小程序的链接是通过 SSL 和经过验证的证书进行的。这些都不能消除警告。

有没有办法让所有警告消失?谁能解释一下幕后发生了什么?

I have a java applet that is downloaded to a user's browser when they visit a webpage and allows them resumable file uploads to my server. Obviously, this requires the applet to access the user's hard disk, which I understand is outside the regular sandbox applets can run in. The user sees a security warning popup which asks for their permission to allow this applet to run.

I have signed the applet using verisign and the link from where is applet is fetched is over SSL with a versigned cert. None of these make the warning go away.

Is there a way to make all warnings go away? Can anyone explain what is going on behind the scenes?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

只是一片海 2024-10-02 03:54:53

JNLP 有一个 FileOpenService,它允许不受信任的 Java Webstart 应用程序向用户显示“文件打开”对话框并访问用户选择的文件:

http://docs.oracle.com/javase/1.5.0/docs/guide/javaws/jnlp/javax/jnlp/FileOpenService .html

JNLP has a FileOpenService which allows the untrusted Java Webstart applications to show a File Open dialog to the user and access the file the user selected:

http://docs.oracle.com/javase/1.5.0/docs/guide/javaws/jnlp/javax/jnlp/FileOpenService.html

巡山小妖精 2024-10-02 03:54:53

您无法避免此消息,如果可以的话,这将是一个安全问题。

授予小程序权限

如果您尝试运行该小程序示例,那么当您单击“Click Me”按钮时,您无疑会看到错误。这是因为 Java 2 平台安全性不允许小程序在没有明确许可的情况下写入和读取文件。

除非特别授予访问权限,否则小程序无法访问本地系统资源。因此,要使 FileUIAppl 程序读取 text.txt 并写入 text.txt,小程序必须是为每个文件提供适当的读取或写入访问权限。

通过策略文件授予访问权限,并使用策略文件启动 appletviewer,以用于正在查看的 applet。

您可以做的是进行配置(策略文件)以允许该小程序使用某些文件。但您必须手动执行此操作(出于明显的安全原因)。检查下面的链接。


资源:

You can't avoid this message, it would be a security issue if you could.

Granting Applets Permission

If you tried to run the applet example, you undoubtedly saw errors when you clicked the Click Me button. This is because the Java 2 Platform security does not permit an applet to write to and read from files without explicit permission.

An applet has no access to local system resources unless it is specifically granted the access. So for the FileUIAppl program to read from text.txt and write to text.txt, the applet has to be given the appropriate read or write access permission for each file.

Access permission is granted with a policy file, and appletviewer is launched with the policy file to be used for the applet being viewed.

What you can do is having a configuration (a policy file) to allow this applet to use some files. But you would have to do this manually (for obvious security reasons). Check the link below.


Resources :

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文