title: Can not use webpack-dev-server as proxy to https website - ERR_TLS_CERT_ALTNAME_INVALID
body: <p>I try to use the <code>webpack-dev-server</code> as a proxy for API requests to the remote test server (in order not to raise a heavy Java server on the local machine). The problem is that the remote server uses only HTTPS. For some reason, it does not accept the certificate from the webpack-dev-server, although it opens correctly from the browser.</p>
  
  <p>My <code>package.json</code> part:</p>
  
  <pre><code>"webpack": "^3.12.0",
  "webpack-dev-server": "^2.11.3"
  </code></pre>
  
  <p>My <code>webpack.config.json</code> part:</p>
  
  <pre><code>// -- DEV-SERVER
  devServer: {
      contentBase: artifact,
      // publicPath: path.join(artifact, 'build', '/'),
      host: "lk-local.net",
      port: 8443,
      https: {
          key: fs.readFileSync('./src/main/profiles/local/cert/webpack/server.key'),
          cert: fs.readFileSync('./src/main/profiles/local/cert/webpack/server.crt'),
          ca: fs.readFileSync('./src/main/profiles/local/cert/webpack/cacert.crt'),
      },
      historyApiFallback: true,
      hot: true,
      headers: {'Access-Control-Allow-Origin': '*'},
      proxy: {
          '/client-config': 'https://dev-2.MYSERVER.ru/client-config',
          '/client-api/*': 'https://dev-2.MYSERVER.ru/client-api/',
          secure: false,
          changeOrigin: true
      }
  }
  </code></pre>
  
  <p>Webpack-dev-server output:</p>
  
  <pre><code>webpack: Compiled successfully.
  [HPM] Error occurred while trying to proxy request /client-api/checkBrowser from lk-local.net:8443 to https://dev-2.MYSERVER.ru/client-api/ (ERR_TLS_CERT_ALTNAME_INVALID) (https://nodejs.org/api/errors.html#errors_common_system_errors)
  [HPM] Error occurred while trying to proxy request /client-config from lk-local.net:8443 to https://dev-2.MYSERVER.ru/client-config (ERR_TLS_CERT_ALTNAME_INVALID) (https://nodejs.org/api/errors.html#errors_common_system_errors)
  </code></pre>
  
  <p>Static opens correctly, requests to the API do not work.</p>
  
  <p>I tried to use a different certificates, and replace <code>https</code> with the <code>true</code>. The result is unchanged.
  How to solve this problem? Thanks!</p>