title: 1and1 HTTPS redirect does not work but HTTP does
body: <p>I have a web app running on Heroku and domain managed by 1und1 (German version of domain registrar 1and1). To make the app available via "example.com" I did the following:</p>
  
  <ol>
  <li>Created www.example.com subdomain in 1und1.</li>
  <li>Attached it to www.example.com.herokudns.com as described in Heroku's guides (CNAME www.example.com.herokudns.com).</li>
  <li>Ordered SSL certs from 1und1 and used them to setup HTTPS on Heroku side.</li>
  <li>Set up HTTP redirect example.com -> <code>https://www.example.com</code> to make top level domain to point to Heroku.</li>
  </ol>
  
  <p>This all worked fine until I tried to get the app by <code>https://example.com</code> - Chrome shows me "This site can’t provide a secure connection" page with ERR_SSL_PROTOCOL_ERROR.</p>
  
  <p>cURL output:</p>
  
  <pre><code>#1.
  curl https://example.com
  curl: (35) Server aborted the SSL handshake
  
  #2.
  curl -vs example.de
  Rebuilt URL to: example.de/
  Trying &lt;example.de 1und1 IP address here&gt;...
  TCP_NODELAY set
  Connected to example.de (&lt;example.de 1und1 IP address here&gt;) port 80 (#0)
  GET / HTTP/1.1
  Host: example.de
  User-Agent: curl/7.51.0
  Accept: */*
  
  &lt; HTTP/1.1 302 Found
  &lt; Content-Type: text/html; charset=iso-8859-1
  &lt; Content-Length: 203
  &lt; Connection: keep-alive
  &lt; Keep-Alive: timeout=15
  &lt; Date: Tue, 11 Jul 2017 14:19:30 GMT
  &lt; Server: Apache
  &lt; Location: http://www.example.de/
  ...
  
  #3.
  curl -vs https://example.de
  Rebuilt URL to: https://example.de/
  Trying &lt;example.de 1und1 IP address here&gt;...
  TCP_NODELAY set
  Connected to wavy.de (&lt;example.de 1und1 IP address here&gt;) port 443 (#0)
  Unknown SSL protocol error in connection to example.de:-9838
  Curl_http_done: called premature == 1
  Closing connection 0
  </code></pre>
  
  <p>So, the question is: how can I set up HTTPS redirect with 1und1 and Heroku?</p>