我有一个heroku应用程序(whatever-app-11123),我想通过ssl(https://myapp.co)使用自定义域。
我已经购买了证书,并按照heroku提供的所有说明进行操作。
奇怪的是,https://whatever-app-11123显示myapp.co证书,而https://myapp.co显示* .herokuapp.com证书。

我需要相反的方法:带有myapp.co证书的myapp.co。

关于如何实现这一目标的任何提示?

不同命令的结果:

herok:证书

Endpoint                           Common Name(s)                            Expires               Trusted
---------------------------------  ----------------------------------------  --------------------  -------
whatever-app-11123.herokuapp.com  myapp.co, www.myapp.co  2017-02-12 23:59 UTC  True


curl -kvI https://www.myapp.co

* Adding handle: conn: 0x7fbd03804000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fbd03804000) send_pipe: 1, recv_pipe: 0
* About to connect() to www.myapp.co port 443 (#0)
*   Trying 46.132.168.142...
* Connected to www.myapp.co (46.132.168.142) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.herokuapp.com
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> HEAD / HTTP/1.1
> User-Agent: curl/7.30.0
> Host: www.myapp.co
> Accept: */*
>
< HTTP/1.1 302 Found
HTTP/1.1 302 Found
* Server Cowboy is not blacklisted

<
* Connection #0 to host www.myapp.co left intact

最佳答案

答案是:检查您的DNS重定向。确保它是CNAME类型,而MOST OF ALL(我做错了)的重定向应该是:

www.myapp.co -> whatever-app-11123.herokuapp.com
myapp.co -> whatever-app-11123.herokuapp.com


并不是

www.myapp.co -> myapp.co
myapp.co -> whatever-app-11123.herokuapp.com

关于ssl - Heroku SSL证书未与自定义域切换,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35380761/

10-13 07:45