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

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

问题描述

当你用谷歌搜索这个异常时:java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty,会出现多个结果.但是没有确定的解决方案,只有猜测.

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)

推荐答案

用于 linux 的标准 Sun JDK 具有绝对正确的 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天全站免登陆