[当我尝试在Mac上使用Rider嵌入式工具和jdbc sql服务器驱动程序连接到远程SQL Server数据库时,出现以下异常:
java.security.cert.CertificateException: Certificates does not conform to algorithm constraints
有问题的算法是在JRE中禁用的MD5withRSA
。我发现我需要更改java.security
文件中的禁用算法列表。更改设置:
jdk.tls.disabledAlgorithms
jdk.certpath.disabledAlgorithms
问题是,由于JRE与应用程序捆绑在一起,因此我找不到Rider应用程序使用的java.security文件。如何更改这些值或找到所需的文件?
我尝试使用虚拟机自定义设置,如以下示例所示,但不起作用:
-Djdk.tls.disabledAlgorithms=
-Djdk.certpath.disabledAlgorithms=
解决方案是使用带有以下参数的vm选项:
-Djava.security.properties=/path/to/my/custom/java.security
/path/to/my/custom/java.security
的内容:
jdk.tls.disabledAlgorithms=MD2, RSA keySize < 1024
jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024