title: "refused to connect" with https and let-encyrpt
body: <p>I've successfully created the SSL certificate and the key for my website via letsencrypt.org . I uploaded them in a folder on the server. I get no errors when I start the server.</p>
  
  <p>But when I try to load the website in the browser using https://, I get the "refused to connect" error.</p>
  
  <p>Here is the code I am using to create the https server:</p>
  
  <pre><code>'use strict';
  
  const express = require('express');
  const fs =  require('fs');
  const http=  require('http');
  const https=  require('https');
  const path = require('path');
  
  const PRIVATEKEY_PATH = path.join(__dirname, '../ssl/server.key');
  const CERTIFICATE_PATH = path.join(__dirname, '../ssl/server.crt');
  
  var privateKey  = fs.readFileSync(PRIVATEKEY_PATH, 'utf8');
  var certificate = fs.readFileSync(CERTIFICATE_PATH, 'utf8');
  var credentials = {key: privateKey, cert: certificate};
  
  // Constants
  const PORT = process.env.PORT || 8080;
  const HOST = '0.0.0.0';
  
  const CLIENT_BUILD_PATH = path.join(__dirname, '../../300meter.ch/build');
  
  // App
  const app = express();
  
  // Static files
  app.use(express.static(CLIENT_BUILD_PATH));
  
  //ssh
  
  var httpServer = http.createServer(app);
  var httpsServer = https.createServer(credentials, app);
  
  // All remaining requests return the React app, so it can handle routing.
  app.get('*', function(request, response) {
    response.sendFile(path.join(CLIENT_BUILD_PATH, 'index.html'));
  });
  
  httpServer.listen(PORT, HOST);
  httpsServer.listen(8443, HOST);
  </code></pre>
  
  <p>If somebody could help me, that would be awesome. Thanks!</p>