javax.naming.Context
的 Java 文档对其字段进行了简短描述,包括 SECURITY_AUTHENTICATION
和 SECURITY_PROTOCOL
here .
与理解它们的目的和行为相关的描述部分是...
对于 SECURITY_AUTHENTICATION:
Constant that holds the name of the environment property for specifying the security level to use. Its value is one of the following strings: "none", "simple", "strong".
对于 SECURITY_PROTOCOL:
Constant that holds the name of the environment property for specifying the security protocol to use. Its value is a string determined by the service provider (e.g. "ssl").
为了测试,我使用了“简单”身份验证,即明文和“ssl”协议(protocol)。
这是如何运作的?客户端应用程序是否会连接到服务器并以明文形式提供主体/凭据,然后对查询和对象修改等进行加密,或者整个通信是否会通过 ssl 隧道、身份验证等,或者它是如何工作的?如果在指定 ssl 协议(protocol)时一切都通过 ssl,为什么会存在 SECURITY_AUTHENTICATION 字段?是对即将通过加密连接(加密两次)的信息进行加密吗?
如果为协议(protocol)指定了一切都通过 ssl,那么我认为即使在生产中使用“简单”和“ssl”也是安全的。有什么理由不这样做吗?
这一切都归结为“它们之间有什么区别?”
最佳答案
连接先于身份验证。首先通过 SSL 建立连接,然后执行身份验证。在通过客户端证书进行身份验证的情况下,这一切都是一步。
“简单”身份验证不是明文。
关于Java 命名 : Security considerations for difference between and uses of SECURITY_AUTHENTICATION and SECURITY_PROTOCOL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31081303/