ssl - Heroku ssl 证书 : Key could not be read since it's protected by a passphrase

标签 ssl heroku openssl ssl-certificate dnsimple

我无法为 secure.mydomain.com 生成 Heroku 接受的 ssl 证书。我正在使用 DNSimple、Cedar Stack,并按照此处的说明进行操作:https://devcenter.heroku.com/articles/ssl-certificate

  1. 从 DNSimple 复制 server.key 和 server.orig.crt
  2. 使用 $ curl https://knowledge.rapidssl.com/library/VERISIGN/ALL_OTHER/RapidSSL%20Intermediate/RapidSSL_CA_bundle.pem > rapidssl_bundle.pem 获取根 CA 证书
  3. cat server.orig.crt rapidssl_bundle.pem > server.crt 连接成一个文件

现在我有了 server.key 和 server.orig.crt 文件,我尝试使用 $ heroku certs:add server.crt server.key 将它们上传到 Heroku。这给出了错误

Key could not be read since it's protected by a passphrase.

上面的文档没有提到任何关于从 server.key 文件中删除密码的内容。所以我四处寻找并在这里找到了文档:https://devcenter.heroku.com/articles/ssl#customdomain-ssl .我在上面的 #1 和 #2 之间运行这些命令:

1b。 $ mv server.key server.orig.key

1c。 $ openssl rsa -in server.orig.key -out server.key

然而这给出了错误

unable to load Private Key
47930:error:0906D06C:PEM routines:PEM_read_bio:no start line:/SourceCache/OpenSSL098/OpenSSL098-47/src/crypto/pem/pem_lib.c:648:Expecting: ANY PRIVATE KEY

我怀疑这意味着没有找到私钥。

有人知道这里的问题是什么吗?这是 Heroku 问题还是 openssl 问题(或 DNSimple 问题)?

最佳答案

我只是在使用 DNSimple 和 RapidSSL 在 Heroku 应用程序上安装 SSL 证书时遇到了几乎相同的问题,并想在此处发布我的解决方案,以防遇到类似问题的人遇到此响应。

我已经按照 SO 和 Heroku 开发中心各处的指示通过 DNSimple 和 RapidSSL 安装证书,但每次我尝试使用以下命令添加证书时:

$ heroku certs:add server.crt bundle.pem server.key

无论我做什么,我都会得到这个错误:

$ Adding SSL Endpoint to mysite... failed
 !    Key could not be read since it's protected by a passphrase.
 !    Read instructions on how to remove the passphrase on:
 !    http://www.madboa.com/geek/openssl/#key-removepass`

我知道 key 没有密码(因为我多次经历了这个过程)但它仍然不想添加它们。我做了两件事,最终让它发挥作用,但我不确定哪一件是决定性因素。

首先,我确保从指向中级证书的 RapidSSL 电子邮件链接中的 Apache、Plesk 和 CPA 框中下载了正确的 PEM 文件。

第二件事是通过以下步骤验证我的 Heroku toolbelt 安装:https://devcenter.heroku.com/articles/heroku-command#installing-the-heroku-cli

事实证明我仍在使用 gem 并且不得不卸载直到我到达 heroku-toolbelt,之后我尝试再次添加证书,瞧。

关于ssl - Heroku ssl 证书 : Key could not be read since it's protected by a passphrase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13304681/

相关文章:

c# - TCP套接字在C#中验证SslStream的SSL证书

ruby-on-rails - 英雄数据库 :pull Failed to connect to database NoMethodError

c - OpenSSL 1_1_0e BN_print_fp 不工作

javascript - 访问存储在 GitHub LFS 中的静态 .obj 文件

docker - 控制台应用程序从 .net core 2.2 迁移到 .net core 3.1 停止允许外部 HTTPs 调用

ssl - 什么是 OCSP 签名证书和 key ?谁应该发行它?

JQuery Mobile 导航在 SSL 上损坏

java - 如何解码 apache-httpclient 生成的 ssl 流量?

php - 通过 SSL 连接使用 DreamFactory SQL

php - 在 Heroku 上指定语言/框架