按照以下步骤:https://devcenter.heroku.com/articles/ssl-endpoint,我已经将SSL Endpoint插件添加到我的Heroku托管服务器。
然后,我按照https://devcenter.heroku.com/articles/ssl-certificate-self的指示创建了一个自签名证书。
现在,我已经使用以下命令上传了我的自签名证书和私钥:
heroku certs:add server.crt server.key
实际上,它给了我:
! Unable to parse certificate. Please ensure the certificate is in PEM format.
但是我在谷歌上找到了一个简单的解决方案:
openssl rsa -in server.key -out server.key.rsa
然后我上传了所有文件:
heroku certs:add server.crt server.key.rsa
Resolving trust chain... done
Adding SSL Endpoint to <myapp>... done
<myapp> now served by wakayama-xxxx.herokussl.com
Certificate details:
Common Name(s): <mydomain>
Expires At: 2016-09-29 11:24 UTC
Issuer: /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<mydomain>
Starts At: 2015-09-30 11:24 UTC
Subject: /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<mydomain>
SSL certificate is self signed.
如果我要在Heroku上请求我的证书,我会得到如下结果:
heroku certs:info
Fetching SSL Endpoint wakayama-xxxx.herokussl.com info for <myapp>... done
Certificate details:
Common Name(s): <mydomain>
Expires At: 2016-09-29 11:24 UTC
Issuer: /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<mydomain>
Starts At: 2015-09-30 11:24 UTC
Subject: /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<mydomain>
SSL certificate is self signed.
所以看起来一切都没问题。 除了...... 如果我去wakayama-xxxx.herokussl.com,我会看到消息:“Heroku | No such app”,嗯,我猜它应该将我重定向到我的应用程序,但没有。
有什么想法吗?