ERR_TLS_CERT_ALTNAME_INVALID
See original GitHub issueExpected behavior
I’m supposed to get the request via proxy
Actual behavior
I’m getting ALTNAME error
Setup
- http-proxy-middleware: 0.17.4
- server: express + 4.15.2
- other relevant modules
proxy middleware configuration
function relayRequestHeaders(proxyReq, req) {
Object.keys(req.headers).forEach(function (key) {
proxyReq.setHeader(key, req.headers[key]);
});
};
function relayResponseHeaders(proxyRes, req, res) {
Object.keys(proxyRes.headers).forEach(function (key) {
res.append(key, proxyRes.headers[key]);
});
};
const options = {
target: 'example.com',
logLevel: 'debug',
onProxyReq: relayRequestHeaders,
onProxyRes: relayResponseHeaders
}
server mounting
var app = express();
app.use('/apps', proxy(options));
app.listen(3000);
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:8
Top Results From Across the Web
npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID
An earlier outage involving a DNS misconfiguration has lead to some ISPs caching npmjs.com as missing, a workaround for this is to use...
Read more >[ERR_TLS_CERT_ALTNAME_INVALID] #NodeJS · GitHub
ERR_TLS_CERT_ALTNAME_INVALID indicates self signed TLS error. Obsured by the following where xxxx.xxx.com can be a variety of host names.
Read more >Getting the [ERR_TLS_CERT_ALRTNAME_INVALID] error ...
Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: api.example.com. is not in the cert's ...
Read more >Hostname/IP does not match certificate's altnames" ... - PTC
"Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames" is seen when creating a Connector that uses ...
Read more >ERR_TLS_CERT_ALTNAME_IN...
ERR_TLS_CERT_ALTNAME_INVALID during deployment through pipeline. Hello,. Getting below error while deploying the changes to app service. ##[ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had same issue. Added
changeOrigin
to fix this andpathRewrite
to fix 404A test https server I was trying to proxy to was using a self signed certificate, I found that by striping all the request headers seemed to allow it to successfully connect and return a response.
I changed the
relayRequestHeaders
function to this;