相关疑难解决方法(0)

为什么java握手期间java不发送客户端证书?

我正在尝试连接到安全的Web服务.

即使我的密钥库和信任库已正确设置,我也会收到握手失败.

经过几天的挫折,无休止的谷歌搜索并询问周围的每个人我发现唯一的问题是java选择不在握手期间将客户端证书发送到服务器.

特别:

  1. 服务器请求客户端证书(CN = RootCA) - 即"给我一个由根CA签名的证书"
  2. Java查看了密钥库,只发现了我的客户端证书,该证书由"SubCA"签署,而"SubCA"又由"RootCA"签发.它没有费心去查看信任库...呃好吧我猜
  3. 可悲的是,当我试图将"SubCA"证书添加到密钥库时,这根本没有帮助.我确实检查了证书是否被加载到密钥库中.他们这样做,但KeyManager忽略除客户端之外的所有证书.
  4. 所有上述情况导致java决定它没有任何满足服务器请求的证书并且什么都不发送... tadaaa握手失败:-(

我的问题:

  1. 我是否有可能以"破坏证书链"或某种方式将"SubCA"证书添加到密钥库中,以便KeyManager仅加载客户端证书并忽略其余证书?(Chrome和openssl设法解决这个问题,为什么不能使用java? - 请注意,"SubCA"证书总是作为受信任的权限单独提供,因此Chrome显然在握手期间正确地将其与客户端证书一起打包)
  2. 这是服务器端的正式"配置问题"吗?服务器是第三方.我希望服务器能够请求由"SubCA"授权机构签署的证书,因为这是他们为我们提供的.我怀疑这个在Chrome和openssl中工作的事实是因为它们"限制性较小"而java只是"按书"而且失败了.

我确实为此设置了一个肮脏的解决方法,但我对此并不高兴所以如果有人能为我澄清这个,我会很高兴.

java ssl https certificate ca

63
推荐指数
2
解决办法
7万
查看次数

将证书导入为PrivateKeyEntry

我在Tomcat服务器上安装SSL,并遵循发行人https://knowledge.rapidssl.com/support/ssl-certificate-support/index?page=content&actp=CROSSLINK&id=SO16181的这些说明,并声明:

Verify the following information:

The SSL certificate is imported into the alias with the "Entry Type" of 
PrivateKeyEntry or KeyEntry.  If not, please import the certificate into 
the Private Key alias.
Run Code Online (Sandbox Code Playgroud)

当我导入证书(tomcat)时我正在使用:

keytool -import -trustcacerts -alias your_alias_name -keystore your_keystore_filename
-file your_certificate_filename
Run Code Online (Sandbox Code Playgroud)

但是当我这样做时它导入为trustCertEntry

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 3 entries

primaryca, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1): <snip>
tomcat, Jul 26, 2014, trustedCertEntry,
Certificate fingerprint (SHA1):  <snip>
secondaryca, Jul 26, 2014, trustedCertEntry,
Certificate …
Run Code Online (Sandbox Code Playgroud)

ssl keystore keytool

14
推荐指数
3
解决办法
5万
查看次数

标签 统计

ssl ×2

ca ×1

certificate ×1

https ×1

java ×1

keystore ×1

keytool ×1