使用 Applet 获取信任
您好,
我最近创建了一个 jar,并使用我创建的密钥库对其进行了签名。
jar 的签名很顺利,但是当我运行小程序时,如果您想运行小程序,它会给出通常的提示,但是,在接受它之后,当小程序尝试连接到 MySQL 数据库(本地运行)时,它会显示再次提示询问您是否要运行此潜在不安全的操作。
有人告诉我,当您签署一个小程序,并且用户单击“是”表示他们想要运行它时,该小程序就会变得受信任吗?但在这种情况下却没有? 我可能被告知了错误的信息。
所以我的问题是,如何防止在操作小程序时弹出这些(相当)烦人的消息?
干杯
Greetings,
I recently created a jar, and signed it with a keystore I created.
The signing of the jar went fine, however when I run the applet, it gives the usual prompt if you want to run the applet or not however, after accepting it, when the applet tries to connect to a MySQL database (ran locally) it prompts yet again asking if you want to run this potentially unsafe operation.
I've been told that when you sign an applet, and the user clicks Yes that they want to run it, that the applet becomes trusted? However in this circumstance it has not?
I may have been told wrong information..
So my question is, how can I keep these (fairly) annoying messages from popping up when operating the applet?
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它可能是由混合签名和未签名代码。要解决此问题,请参阅部署签名部分应用程序和小程序安全无混合代码警告。
It is probably triggered by Mixing Signed and Unsigned Code. To fix the problem, see the section on Deploying Signed Applications and Applets Securely Without a Mixed Code Warning.
如果我没记错的话(十多年前我就这么做了,所以我在这里可能大错特错了),小程序不会变得“受信任”,而是签名提供了一个标识符,然后将用户授予的权限附加到该标识符上。因此,未签名的代码不受信任的原因是因为无法附加权限,但签名的代码在运行后不会变得受信任。
因此,每次安装该警告应该只弹出一次。有一个 API 可以显式请求权限,因此,如果您使用的权限不止于此,您可以一次请求所需的所有权限,但您无法真正避免用户被询问是否要扩展您的小程序的权限。
If I remember correctly (I did that over ten years ago, so I might be horribly wrong here), the applet doesn't become "trusted", but rather, the signature provides an identifier to which privileges granted by the user are then attached. So the reason unsigned code is untrusted is because there is no way to attach the privilege, but signed code does not become trusted the second it is run.
The warning should pop up only once per installation thus. There is an API to explicitly request privileges, so in case you use more than this one, you can ask for all that you require in a single go, but you cannot really avoid the user getting asked whether they want to extend your applet's privileges.