0

im kind of new to this and I was just wondering, in an ssl application, ideally in a real world situation, would the server and client both have copies of the exact same .keystore file, or would this be a security risk. Is there any other way to do this without the client having a copy of the actual keystore file?

4

2 回答 2

3

不,客户端和服务器不需要相同的密钥库(通常它们不一样),尽管如果它们相同,它将起作用。

SSL 连接在握手阶段依赖于非对称公钥/私钥加密,一旦连接建立,就会切换到对称密钥加密。

基本情况是:

  • 服务器将其公钥发送给客户端。
  • 客户端响应使用服务器公钥加密对称密钥。
  • 只有服务器拥有解密对称密钥所需的私钥,它确实如此。
  • 客户端和服务器然后使用对称密钥加密它们之间传递的所有数据。

就像我说的那样,这是基础知识,关于检查证书和握手的方式,这里描述的还有更多内容。

于 2013-05-24T12:21:05.693 回答
1

当然不

两个实体使用相同的私钥和证书将是一个重大的安全漏洞。私钥是错误的,是私有的,并且证书旨在对应于拥有该私钥的唯一身份。任何违反该原则的行为都是基本的安全错误。

于 2013-05-26T23:26:40.570 回答