I have a reverse proxy on my endpoint like this:
var express = require('express');
var app = express();
var httpProxy = require('http-proxy');
var apiProxy = httpProxy.createProxyServer();
var serverOne = 'https://idena.navarra.es/ogc/wms?';
app.all('/idena', function (req, res) {
apiProxy.web(req, res, {target: serverOne});
});
app.listen(3000, function () {
console.log('Working!');
});
When a request to /idena
is received, the server throws an exception like this:
Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: localhost. is not in the cert's altnames: DNS:idena.navarra.es, DNS:www.idena.navarra.es at Object.checkServerIdentity (tls.js:235:17) at TLSSocket.onConnectSecure (_tls_wrap.js:1061:27) at TLSSocket.emit (events.js:189:13) at TLSSocket._finishInit (_tls_wrap.js:633:8)
How can I solve this? Guess is due to https
but no idea of how to avoid that, thanks!