Parse and Heroku Service(4)SSL Endpoint

本文详细介绍了如何在Heroku上为应用程序设置SSL证书。主要内容包括购买SSL证书、配置Heroku SSL端点、上传证书到Heroku、更新DNS设置以及一些高级操作如更新或移除证书等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Parse and Heroku Service(4)SSL Endpoint

1 Overview
If we need a customized domain, we may need to pay some extra money to buy the service
https://elements.heroku.com/addons/ssl

> heroku addons:create ssl:endpoint

Steps to SSL
1 Purchase an SSL certificate from your SSL provider
2 Provision an SSL endpoint from Heroku
3 Upload the certificate to Heroku
4 Update your DNS settings to reference the new SSL endpoint URL

For our case, we already have the SSL certificate.

2 Setting up SSL on Heroku

In the app, enable the plugins
>heroku addons:create ssl:endpoint

Add the key
> heroku certs:add server.crt server.key

At the end of this step, we will have a URL.

Verify the details
> heroku certs

> heroku certs:info

At this point, if we visit the URL displayed in the previous step, we will have an exception as follow:
www.example.com doesn’t match example-2121.herokussl.com

That is right. SSL is working there.

DNS and Domain Configuration
> heroku domains:add www.example.com

forward the DNS to our herokussl.com, for example:

Record Name Target
CNAME www example-2121.herokussl.com.
CNAME * example-2121.herokussl.com.

Verify the SSL
> curl -kvI https://www.example.com

3 Advanced Operation
Update the Certificate
>heroku certs:update server.crt server.key

Undo the Update
> heroku certs:rollback

Remove certificate
> heroku certs:remove

Tips:
A .csr file is a certificate signing request, which initiates your certificate request with a certificate provider and contains administrative information about your organization.

A .key file is the private key used for your site’s SSL-enabled requests.

.pem and .crt extensions are often used interchangeably and are both base64 ASCII encoded files. The technical difference is that .pem files contain both the certificate and key whereas a .crt file only contains the certificate.

References:
https://devcenter.heroku.com/articles/ssl-endpoint#overview
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值