Closed laztheripper closed 1 year ago
Thanks for the feedback; this is more of a platform concern rather than this library (as demonstrated via the curl
commands). However, you may be able to use --dns-result-order=ipv4first
in the command line to resolve this issue without changing OS-level configuration:
Or, in windows open cmd:
curl -6 https://www.googleapis.com/oauth2/v1/certs curl -4 https://www.googleapis.com/oauth2/v1/certs
-6 will fail, -4 won't.
Actually, curl -6 https://www.googleapis.com/oauth2/v1/certs
works (I've verified this locally as well). Perhaps there's another networking issue?
Or, in windows open cmd:
curl -6 https://www.googleapis.com/oauth2/v1/certs curl -4 https://www.googleapis.com/oauth2/v1/certs
-6 will fail, -4 won't.
Actually,
curl -6 https://www.googleapis.com/oauth2/v1/certs
works (I've verified this locally as well). Perhaps there's another networking issue?
Perhaps, although it is strange because the server and my personal pc aren't on the same ip or region and have the same issue, and I've found dozens of questions/issues on stackoverflow that mention various google apis not being resolved via ipv6.
Thanks for the tip about --dns-result-order=ipv4first
however :+1:
System:
Problem: Recent versions of nodejs prefer ipv6 DNS resolution, and the OAuth2Client is getting 403: Forbidden from
https://www.googleapis.com/oauth2/v1/certs
unless ipv6 is disabled on the machine globally, or forced to ipv4 in node. Disabling ipv6 for the entire nodejs process just to get OAuth2Client to work is not ideal.Repro: On Ubuntu 20.04 having ipv6 properly configured,
curl -v https://www.googleapis.com/oauth2/v1/certs
Response will beDisable ipv6 for the next test
Do it again
curl -v https://www.googleapis.com/oauth2/v1/certs
That should work as expected.
Or, in windows open cmd:
-6 will fail, -4 won't.
OAuth2Client needs to make requests using ipv4 resolution, at least for this specific url. Thanks