java.security.InvalidAlgorithmParameterException:在Linux上,trustAnchors参数必须为非空,或者为什么默认的信任库为空 [英] java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty on Linux, or why is the default truststore empty

查看:262
本文介绍了java.security.InvalidAlgorithmParameterException:在Linux上,trustAnchors参数必须为非空,或者为什么默认的信任库为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当你谷歌出现此异常时: java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空,会出现多个结果。然而,没有确定的解决方案,只有猜测。

When you google for this exception: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty, multiple results appear. However there is no definitive solution, only guesses.

当我尝试使用通过SSL打开连接时,问题出现了(至少在我的情况下)。它在我的Windows机器上工作正常,但是当我将它部署到linux机器(安装了sun的jre)时,它失败并出现上述异常。

The problem arises (in my case at least) when I try to use open a connection over SSL. It works fine on my windows machine, but when I deploy it to the linux machine (with sun's jre installed) it fails with the above exception.

问题在于由于某种原因,JRE的默认信任库为空(大小仅为32字节,而在Windows上为80kb)。

The problem is that the default truststore of the JRE is empty for some reason (size of only 32 bytes, whereas it is 80kb on windows).

当我复制时jre / lib / security / cacerts 从windows到linux的文件,它运行正常。

When I copied my jre/lib/security/cacerts file from windows to linux, it worked fine.

问题是 - 为什么linux jre有一个空信任存储?

The question is - why is the linux jre having an empty trust store?

请注意,这种情况发生在使用AMI linux的Amazon EC2实例上,因此可能是由于一些亚马逊政策(我认为java是预先的安装,但我不确定)

Note that this happens on an Amazon EC2 instance, with the AMI linux, so it might be due to some amazon policies (I think java was pre-installed, but I'm not sure)

推荐答案

标准的Sun JDK for linux有一个绝对正常的cacerts和整个所有文件指定的目录。问题是您使用的安装。

The standard Sun JDK for linux has an absolutely ok cacerts and overall all files in the specified directory. The problem is the installation you use.

这篇关于java.security.InvalidAlgorithmParameterException:在Linux上,trustAnchors参数必须为非空,或者为什么默认的信任库为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆