Answer the question
In order to leave comments, you need to log in
Net::ERR_CERT_COMMON_NAME_INVALID?
When the client side requests data from the server via https request, an error occurs:
GET https://ip:5001/api/cards/online net::ERR_CERT_COMMON_NAME_INVALID
const env = {
port: 5001
};
module.exports = env;
const app = require('./app');
const https = require('https');
const config = require('./config/env');
const fs = require('fs');
https.createServer({
key: fs.readFileSync('/etc/ssl/snkey.key'),
cert: fs.readFileSync('/etc/ssl/sncrt.crt')
}, app).listen(config.port, () => {
console.log(`Server has been started on ${config.port}`);
});
Answer the question
In order to leave comments, you need to log in
COMMON_NAME_INVALID is written that the client does not like the CN in the certificate (the CN does not match the domain name you are going to, in your case it is IP). When using IP in the address bar, no browser will consider such a connection to be trusted. Most likely all of it is self-signed. Add the "Ignore certificate verification" option on the client.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question