Express Cert Troubleshooring

103 views Asked by At

I've been having SSL issues with my site for the last year now, and I don't know where to even look for the cause.

When using my site API through postman, I get a generic "Could not get any response" error in postman. If I go into setting and disable SSL verification, the error is gone and everything works. Also, Occasionally mobile browsers will give a warning about the certificate that the user will have to bypass to get to the site. But usually, the sites cert info is fine and you get the green lock on the browser. enter image description here

It's just a simple express server setup. I'm hoping someone can see the issue with my implementation.

const app = express();

//security suite middleware
app.use(helmet());

//Here we are configuring express to use body-parser as middle-ware.
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());

let routes = require('./routes');
app.use(routes);
let privateKey = fs.readFileSync('src/server/config/keys/privateKey.key');
let certificate = fs.readFileSync('src/server/config/keys/certificate.crt');
https.createServer({
    key: privateKey,
    cert: certificate
}, app).listen(8081, () => console.log("Listening on port 8081!"));
0

There are 0 answers