Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would you resolve the [DEP0123] deprecation warning when using Cloud SQL from an external Node.js instance?

When connecting to the CloudSQL DB, you must provide the PostgreSQL configuration details (this makes sense). When getting the necessary address information from Google's configuration page, you are provided with an external IP address (and nothing else as far as external solutions work) to connect to it. This then produces a warning when using it:

(node:18101) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an
  IP address is not permitted by RFC 6066. This will be ignored in a future 
  version.

I have tried researching about this warning, and am struggling to come up with a proper resolution for this, since Google does not provide any sort of servername (or similar) for this. I'm thinking one solution could be to externally add a subdomain to my companies servers that points to this IP address, but to be honest that is not very ideal for us (if it's the only solution though, that is fine). This is a server running Node 12.7.0 on Debian 9.9 (stretch), connecting to CloudSQL PostgreSQL 11 (beta).

Obviously the expected solution is to remove all [deprecation] warnings from a production code-base, so looking to resolve that, and any ideas of how best to attack that since nobody seems to have posted this elsewhere!

Edit: I was able to resolve this by adding proper hostnames to said IPs. Not sure if there is a better solution (if you find one, please let me know!), but this will work in the interim since keeping the external server around is only a short-term scenario for us anyways. Related issue created for adding this to the documentation: https://github.com/brianc/node-postgres/issues/1950

like image 753
Justin Kyryliuk Avatar asked Nov 07 '22 14:11

Justin Kyryliuk


1 Answers

I changed from IP name to DNS name and the error is gone.

like image 150
EOKNA-IT Avatar answered Dec 15 '22 14:12

EOKNA-IT