title: How can I proxy to a ssl endpoint with the webpack-dev-server proxy
body: <p>When I try to proxy this <code>http://localhost:9000/rpc</code> request, I receive:</p>
  
  <pre><code>cannot proxy to https://example.appspot.com:80 
    (write EPROTO  101057795:error:140770FC:SSL routines:
    SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:)
  </code></pre>
  
  <p>webpack-dev-derver config:</p>
  
  <pre><code>devServer: {
      contentBase: "./",
      hostname: 'localhost',
      port: 9000,
      proxy: {
          '/rpc': {
              target: 'https://example.appspot.com',
              secure: false,
              changeOrigin: true     // **Update-2 SOLVED**
          }
      }
  }
  </code></pre>
  
  <p>I use <a href="https://github.com/github/fetch" rel="noreferrer">fetch</a> : <code>fetch('/rpc' ...</code> to make the request and Windows 10 professional to run webpack.</p>
  
  <p>Without the proxy : <code>fetch('https://example.com/rpc' ...</code> the SSL request works fine. </p>
  
  <p><strong>Update. I had to use the SSL port 443</strong> (see the answer of Steffen).<br>
  Now using: <a href="https://example.appspot.com:443" rel="noreferrer">https://example.appspot.com:443</a> </p>
  
  <p>But still not working with <code>secure: true</code>. The console log shows: </p>
  
  <pre><code>cannot proxy to https://example.appspot.com:443 
  (Hostname/IP doesn't match certificate's altnames: "Host: localhost. 
  is not in the cert's altnames: DNS:*.appspot.com, DNS:*.thinkwithgoogle.com,
  DNS:*.withgoogle.com, DNS:*.withyoutube.com, DNS:appspot.com,
  DNS:thinkwithgoogle.com, DNS:withgoogle.com, DNS:withyoutube.com")
  </code></pre>
  
  <p>And with <code>secure: false</code>. The console reports: <code>404 (Not Found)</code></p>
  
  <p><strong>Update: SOLVED</strong> using <code>changeOrigin: true</code>. Docs <a href="https://github.com/nodejitsu/node-http-proxy#options" rel="noreferrer">here</a>.</p>