sidorares / sidorares/node-mysql2
Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 680
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 59
Description
Im trying to connect to a Google Cloud Platform MySQL instance with SSL enabled using a public IP. However I get the error:
Error: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: IP: xx.xx.xxx.xx is not in the cert's list
If I set reject unauthorised to false it works correctly.
There is no way to add the IP to the altnames because Google generates the certificates automatically. I also can't connect to the instance using a hostname because that isn't supported by Google. I've tried adding checkServerIdentity: () => null to the ssl options but get the same results. Is there any secure work around to this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report names no repository file, test, or entry point. Begin with the connection's SSL configuration and Node.js certificate validation, reproducing the failure with rejectUnauthorized enabled against a Google Cloud MySQL public IP. Done would require a documented secure resolution or a repository change with regression coverage, but the issue does not define either.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, mysql, node.js
- Domain
- backend, databases, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100