title: node https ssl your connection is not private error
body: <p>I recently bought an ssl certificate and i am having a problem with google chrome when i access my website it says 'Your connection is not private NET::ERR_CERT_AUTHORITY_INVALID' here is what i am doing:</p>
  <pre><code>const express = require(&quot;express&quot;);
  const https = require('https');
  const helmet = require(&quot;helmet&quot;);
  const cors = require(&quot;cors&quot;);
  const fs = require(&quot;fs&quot;);
  const path = require(&quot;path&quot;);
  const app = express();
  const config = require(&quot;./config&quot;);
  const passport = require(&quot;passport&quot;);
  const credentials = { key: fs.readFileSync('ssl/site.key', 'utf-8'), cert: fs.readFileSync('ssl/site.crt', 'utf-8') + fs.readFileSync('ssl/site.ca-bundle', 'utf-8') };
  
  app.use(helmet());
  app.use(cors());
  app.use(express.json());
  app.use(express.urlencoded({ extended: false }));
  app.use(
    require(&quot;express-session&quot;)({
      secret: require(&quot;./config.json&quot;).app.secretKey,
      resave: false,
      saveUninitialized: true,
      cookie: {
        secure: false,
        maxAge: 60 * 60 * 1000 * 24 * 365,
      },
    })
  );
  
  app.use(passport.initialize());
  app.use(passport.session());
  passport.use(require(&quot;./service/passport&quot;));
  
  app.set(&quot;view engine&quot;, &quot;ejs&quot;);
  app.set(&quot;views&quot;, path.join(__dirname, &quot;views&quot;));
  app.use(express.static(path.join(__dirname, &quot;views&quot;)));
  
  app.use(&quot;/&quot;, require(&quot;./api/views&quot;));
  app.use(&quot;/auth&quot;, require(&quot;./api/auth&quot;));
  app.use(&quot;/answer&quot;, require(&quot;./api/answer&quot;));
  app.use(&quot;/user&quot;, require(&quot;./api/views/user.view&quot;));
  app.use(&quot;/courses&quot;, require(&quot;./api/views/courses.view&quot;));
  app.use(&quot;/question&quot;, require(&quot;./api/views/question.view&quot;));
  app.use(&quot;/answer&quot;, require(&quot;./api/views/answer.view&quot;));
  
  app.use(&quot;/api/user&quot;, require(&quot;./api/user&quot;));
  app.use(&quot;/api/course&quot;, require(&quot;./api/course&quot;));
  app.use(&quot;/api/feedback&quot;, require(&quot;./api/feedback&quot;));
  app.use(&quot;/api/help&quot;, require(&quot;./api/help&quot;));
  app.use(&quot;/api/questions&quot;, require(&quot;./api/question&quot;));
  
  var httpsServer = https.createServer(credentials, app);
  
  httpsServer.listen(config.app.port);
  
  console.log(credentials);
  //app.listen(config.app.port);
  </code></pre>
  <p>I have seen that a lot of people had the same problem what should i do?</p>