我正在尝试使用高朗马提尼在Heroku上部署HTTPS web端。
下面是我已经做过的清单:
heroku certs显示:(注意:公司名称/端点地址更改)终结点
xxx.herokussl.com \x{e 010}\x{e76f}\x{e76f}205-25 23:59 UTC \x{e76f}真
这是我在Golang的代码示例。
m := martini.Classic()
martini.Env = martini.Prod
m.Use(secure.Secure(secure.Options{
SSLRedirect: false,
}))
//Because I want to keep HTTP and HTTPs enable.
go func() {
if err := http.ListenAndServe(":"+os.Getenv("PORT"), m); err != nil {
log.Println(err)
}
}()
// HTTPS:
if err := http.ListenAndServeTLS(":443", "server.crt", "server.key", m); err != nil {
log.Println(err)
}以下是我的问题:
ListenAndServeTLS端口设置为8443 (或其他什么东西),那么当我尝试用curl -vI https://server.sample.com进行测试时,它将显示错误。它将显示错误如下:
curl:(60) SSL证书问题:无效证书链ListenAndServeTLS端口设置为443,它将显示:
“侦听tcp :443: bind:许可被拒绝”请告诉我如何在Heroku上部署带的HTTPs,谢谢..
发布于 2015-05-28 08:54:02
如果您部署到Heroku,您的应用程序将不提供HTTPS。SSL连接将在Heroku的负载平衡器上终止,普通HTTP流量将被转发到您的应用程序。
所以,您所要做的就是从环境中监听端口上的HTTP。
https://stackoverflow.com/questions/30501388
复制相似问题