title: Heroku: SSL Endpoint - subjectAltName does not match www.mydomain.com
body: <p>I have just been setting up my first app that requires ssl.</p>
  
  <p>It's RoR app, hosted on Heroku.</p>
  
  <p>I have added the SSL Endpoint add-on to my app.
  I purchased a SSL certificate from DNSimple.</p>
  
  <p>Then followed these instructions - <a href="https://devcenter.heroku.com/articles/ssl-certificate" rel="noreferrer">https://devcenter.heroku.com/articles/ssl-certificate</a>
  to concatenate the necessary files. Then uploaded them to my server.</p>
  
  <p>So far so good.</p>
  
  <p>Following these instructions - <a href="https://devcenter.heroku.com/articles/ssl-endpoint#testing-your-certificate" rel="noreferrer">https://devcenter.heroku.com/articles/ssl-endpoint#testing-your-certificate</a>
  for testing my certificat seems fine.</p>
  
  <p>I have updated my DNS records with a CNAME that points to my Heroku generated Endpoint.</p>
  
  <pre><code>heroku certs
  </code></pre>
  
  <p>gives:</p>
  
  <pre><code>Endpoint                      Common Name(s)                          Expires               Trusted
  ----------------------------  --------------------------------------  --------------------  -------
  &lt;generated_id&gt;.herokussl.com  www.mydomain.com, mydomain.com          2014-04-29 23:25 UTC  True
  </code></pre>
  
  <p>But when I try:</p>
  
  <pre><code>curl -v https://www.mydomain.com
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>* About to connect() to www.mydomain.com port 443 (#0)
  *   Trying 107.20.162.205... connected
  * Connected to www.mydomain.com (107.20.162.205) port 443 (#0)
  * SSLv3, TLS handshake, Client hello (1):
  * SSLv3, TLS handshake, Server hello (2):
  * SSLv3, TLS handshake, CERT (11):
  * SSLv3, TLS handshake, Server finished (14):
  * SSLv3, TLS handshake, Client key exchange (16):
  * SSLv3, TLS change cipher, Client hello (1):
  * SSLv3, TLS handshake, Finished (20):
  * SSLv3, TLS change cipher, Client hello (1):
  * SSLv3, TLS handshake, Finished (20):
  * SSL connection using AES256-SHA
  * Server certificate:
  *    subject: C=US; ST=California; L=San Francisco; O=Heroku, Inc.; CN=*.herokuapp.com
  *    start date: 2011-04-11 00:00:00 GMT
  *    expire date: 2014-04-15 12:00:00 GMT
  *    subjectAltName does not match www.mydomain.com
  * Closing connection #0
  * SSLv3, TLS alert, Client hello (1):
  * SSL peer certificate or SSH remote key was not OK
  curl: (51) SSL peer certificate or SSH remote key was not OK
  </code></pre>
  
  <p>Any help appreciated.</p>