Error code
Node.js ERR_TLS_CERT_ALTNAME_INVALID
NODE.JSERR_TLS_CERT_ALTNAME_INVALID
Runtime Error Code· An error code from a programming runtime or package manager, like Node.js or npm.
What it means
The hostname does not match any Subject Alternative Name in the TLS certificate presented by the server.
How to fix it
- Verify you are connecting to the correct hostname.
- Obtain or renew a certificate that includes the correct SANs.
- Do not set rejectUnauthorized:false in production — fix the certificate instead.
Not affiliated with Node.js. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.
More Node.js codes
- ERR_BUFFER_OUT_OF_BOUNDSAn offset or length value provided to a Buffer method falls outside the buffer's boundaries
- ERR_DLOPEN_FAILEDNode.js failed to load a native addon (.node file) using dlopen/LoadLibrary
- ERR_FS_FILE_TOO_LARGEThe file is larger than the maximum size that can be read into memory by fs.readFile
- ERR_HTTP_HEADERS_SENTAn attempt was made to set or send HTTP response headers after the response has already been sent
- ERR_INTERNAL_ASSERTIONAn internal Node.js assertion failed — this indicates a bug in Node.js itself
- ERR_INVALID_ARG_TYPEA function was called with an argument of the wrong type
- ERR_INVALID_ARG_VALUEA function argument has a valid type but an invalid or out-of-range value
- ERR_INVALID_FILE_URL_PATHA file: URL has a path that is invalid on the current operating system
- ERR_INVALID_MODULE_SPECIFIERThe module specifier string passed to import() or require() is not a valid module identifier
- ERR_INVALID_PACKAGE_CONFIGThe package.json file for a module is malformed and cannot be parsed
- ERR_INVALID_PACKAGE_TARGETThe target in the package.json exports or imports map is invalid
- ERR_INVALID_RETURN_VALUEA hook or callback returned a value of the wrong type