Java 1.7.51 internet restrictions for applets

蹲街弑〆低调 提交于 2019-12-05 01:22:08

问题


In the previous months I developed a sandbox Java applet for an academic project. I wasn't able to sign it with a trusted Certificate Authority because of the restricted budget. With the release of Java 1.7.51 I found that the new security restrictions forbid the execution of the applet, because of the lack of signature.

Until now, I have found two rough solutions to this problem:

  1. ask the user to include the applet page on his/her exception lists;
  2. ask the user to set the Java security level to "Medium" (which, of course, is a risky manoeuvre).

Is there a way to overcome the restrictions imposed by Java with a self-signed applet without asking the user to change the security settings?

I would deeply thank you for your answers, since the option to buy a trusted certificate remains an expensive one.


回答1:


Is there a way to overcome the restrictions imposed by Java with a self-signed applet without asking the user to change the security settings?

Short answer, no. Long answer, nope.




回答2:


Its not a real solution but maybe a bit more convenient for the enduser: Write a small programm (as jar file, or batch) which adds your site to the exception list. This tiny programm you offer to the user which can't execute your applet. It only has to be executed once. How this can be done is described here.

The file controlling the Exception Site List is stored in the user’s deployment location as described in the deployment configuration. On Windows 7 the location is C:\Users\username\AppData\LocalLow\Sun\Java\Deployment\security\exception.sites. The format is one site per line.

If you think that is not really trustworthy to the user you are probably right ;-) who executes a file downloaded from the internet? You can also just add a small description to your page and a user could execute it from commandline. For windows it would like that:

mkdir %USERPROFILE%\AppData\LocalLow\Sun\Java\Deployment\security
echo http://www.carlos.com >> %USERPROFILE%\AppData\LocalLow\Sun\Java\Deployment\security\exception.sites

The more I read my post I think the best solution is the certificate but still wanted to share this option.



来源:https://stackoverflow.com/questions/21238199/java-1-7-51-internet-restrictions-for-applets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!