gpt4 book ai didi

maven - 在 Maven 构建中使用小 dh key 的信任存储库

转载 作者:行者123 更新时间:2023-12-04 19:41:19 28 4
gpt4 key购买 nike

在我新设置的 CentOS 8 VM 中使用 maven 构建我的项目时,当 maven 尝试从我们的内部连接下载依赖项时,我收到以下错误:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.120 s
[INFO] Finished at: 2020-03-25T17:43:34+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myproject: Could not resolve dependencies for project our.domain:myproject:jar:1.5.0: Failed to collect dependencies at our.domain.internal:internal-commons:jar:0.12.3: Failed to read artifact descriptor for our.domain.internal:internal-commons:jar:0.12.3: Could not transfer artifact our.domain.internal:internal-commons:pom:0.12.3 from/to nexus-proxy (https://nexus.our.domain/repository/maven-public/): DH ServerKeyExchange does not comply to algorithm constraints -> [Help 1]

当我尝试阅读该链接上的任何网页时,也会出现此问题:

[root@localhost Daisy]# curl https://nexus.our.domain
curl: (35) error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small


我尝试使用以下方法手动将 key 添加到我的 known_hosts 文件中:

ssh-keyscan -p 443 nexus.our.domain >> ~/.ssh/known_hosts

但是我返回时没有任何控制台输出,也没有更改文件。运行

ssh-keyscan -p 443 nexus.our.domain

也根本不产生任何输出。

我已经向管理我们关系的内部团队报告了这个问题。

我仍然会很感激任何强制我的虚拟机接受我们关系的 key 的解决方案,这样我就不必等到交换 key 。我可以在客户端 (VM) 端的任何级别(Maven、https、ssl 或任何更低级别)中自由处理此问题。

使用的版本:

CentOS : CentOS Linux 发行版 8.1.1911 (Core)

马文 :

[root@localhost Daisy]# mvn --version
Apache Maven 3.5.4 (Red Hat 3.5.4-5)
Maven home: /usr/share/maven
Java version: 11.0.5, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk-11.0.5.10-2.el8_1.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.18.0-147.5.1.el8_1.x86_64", arch: "amd64", family: "unix"

SSH :OpenSSH_8.0p1,OpenSSL 1.1.1c FIPS 2019 年 5 月 28 日

最佳答案

更改 /etc/crypto-policies/back-ends/opensslcnf.config 中的第一行:

- CipherString = @SECLEVEL=2:kEECDH:kRSA:kEDH:kPSK:kDHEPSK:kECDHEPSK:-aDSS:-3DES:!DES:!RC4:!RC2:!IDEA:-SEED:!eNULL:!aNULL:!MD5:-SHA384:-CAMELLIA:-ARIA:-AESCCM8
+ CipherString = @SECLEVEL=1:kEECDH:kRSA:kEDH:kPSK:kDHEPSK:kECDHEPSK:-aDSS:-3DES:!DES:!RC4:!RC2:!IDEA:-SEED:!eNULL:!aNULL:!MD5:-SHA384:-CAMELLIA:-ARIA:-AESCCM8

(将 SECLEVEL=2 更改为 SECLEVEL=1)

为了运行 maven 构建,我还必须更改 jvm 设置:
What does "Reason: DHPublicKey does not comply to algorithm constraints" mean?

请记住,这只是一种解决方法。该设置是安全设置,通常不应更改。

关于maven - 在 Maven 构建中使用小 dh key 的信任存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60854090/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com