我在 heroku 上免费托管我的网站。所以我必须手动启用 SSL,因为他们的自动化版本只能从 hobby dyno 开始使用。
我使用以下方法生成了证书:
sudo certbot certonly --manual
当我尝试添加证书时:
sudo heroku certs:add /etc/letsencrypt/live/www.sitename.com/fullchain.pem /etc/letsencrypt/live/www.sitename.com/privkey.pem
我收到了这个错误:
▸ You need to be running on either Hobby or Professional dynos to be able to use SNI SSL.
我认为手动执行此操作是可能的,但显然即使手动我也需要爱好版本。
最佳答案
绕过 Heroku 的 cert
统统。通过合并 cert
,我能够保护我的免费关卡登台站点。文件到 Procfile
:
web: gunicorn mysite.wsgi --timeout 90 --certfile /certs/fullchain.pem --keyfile /certs/privkey.pem --keep-alive 5 --log-level debug --log-file -
方法应该类似于 nginx
或 apache
.只需将其放入您的 Procfile
.
关于ssl - HEROKU 免费层 SSL : You need to be running on either Hobby or Professional dynos to be able to use SNI SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64747197/