gpt4 book ai didi

SSL:错误:0B080074:x509 证书例程:X509_check_private_key: key 值不匹配但模数匹配

转载 作者:太空宇宙 更新时间:2023-11-03 13:16:20 25 4
gpt4 key购买 nike

我的 nginx 服务器带有 StartSSL 免费证书,该证书即将过期。我想更新它。

openssl req -new -sha256 -nodes -days 365 -newkey rsa:2048 -keyout ssl.key -out ssl.csr

我在其中输入生成证书所需的信息。我将此 CSR 粘贴到网站中,并成功获得了域和主域上的 2 个子域的签名证书。

在我加载证书服务器后输出这个错误:

feb 05 17:46:19 systemd[1]: Unit nginx.service entered failed state.
feb 05 17:47:13 nginx[4514]: nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/nginx/ssl/nginx.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch
feb 05 17:47:13 nginx[4514]: nginx: configuration file /etc/nginx/nginx.conf test failed
feb 05 17:47:13 systemd[1]: nginx.service: control process exited, code=exited status=1
feb 05 17:47:13 systemd[1]: Failed to start A high performance web server and a reverse proxy server.

我用这些命令测试了模数:

openssl x509 -noout -modulus -in nginx.crt | openssl md5
openssl rsa -noout -modulus -in nginx.key | openssl md5
openssl req -noout -modulus -in ssl.csr | openssl md5

并且它们匹配。

StartSSL 提供带有中间证书的证书包。我发现如果它们的顺序不正确,它可能会失败,所以我尝试将它们作为第一个证书,但没有成功。

编辑:我尝试在另一台使用 nginx 1.9.3 的服务器上进行 key 和证书,它正在运行。所以证书没问题,但服务器不行。

最佳答案

请在创建 bundle 时检查证书序列。它应该按以下顺序:

  1. 服务器证书

  2. 中级证书

  3. 根证书

这可能是错误背后的原因。

关于SSL:错误:0B080074:x509 证书例程:X509_check_private_key: key 值不匹配但模数匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35242943/

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