java socket权限问题 [英] java socket permission problem
问题描述
我需要通过小程序内的 Socket 写入远程机器.小程序驻留在封闭医院系统内的内部网中,因此更改 java 安全文件不是问题.在 Oracle 网站上,他们建议进行以下政策更改:
I have a need to write to a remote machine via a Socket from within an applet. The applet resides within an intranet within a closed hospital system so changing the java security file is not an issue. From the Oracle site, they recommend the following policy change:
授予{权限 java.net.SocketPermission"10.130.71.156:8000", "连接,接受";};
grant { permission java.net.SocketPermission "10.130.71.156:8000", "connect,accept"; };
我已经这样做了,但我仍然收到以下错误:
I have done this but I am still getting the following error:
java.security.AccessControlException: access denied (java.net.SocketPermission [10.130.71.156:8000]resolve)
对问题可能是什么有任何想法吗?
Any ideas of what the problem could be?
推荐答案
存在导致错误的配置问题.配置文件中的 IP 地址与策略文件中的 IP 地址不匹配.这就是出现安全错误的原因.在他们的评论中推荐使用通配符的人 (ataylor) 应该回答这个问题.通配符允许我们查看正在轮询的 DNS.谢谢!
There was a configuration problem that was causing the error. The IP address in the config file did not match the IP address in the policy file. That is why there was the security error. The person (ataylor) who in their comment recommended using the wildcard deserves the credit for answering this one. The wildcard allowed us to see what DNS was being polled. Thank you!
艾略特
这篇关于java socket权限问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!