我在我的端点上有一个反向代理,就像这样:
当收到对
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!');
});
当收到对
/idena
的请求时,服务器会抛出以下异常:
如何解决这个问题呢?猜测可能是由于使用了Error [ERR_TLS_CERT_ALTNAME_INVALID]: 主机名/IP不匹配证书的备用名称:主机名:localhost不在证书的备用名称中: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)
https
导致的,但不知道如何避免,谢谢!