-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vault contacts DNS to get SRV record if port number does not appear in https VAULT_ADDR #5540
Comments
As workaround it's possible to add the following SRV record
It speeds vault calls up by few times. |
This one seems to be quite old, but I'm having exactly the same problem, increasing request times dramatically, is there any fix planned for this? |
Related issue: #5525 |
petems
added a commit
to petems/terraform-provider-vault
that referenced
this issue
Jul 15, 2020
* Resolved SRV issue hashicorp/vault#5540 * Closes hashicorp#805
abh
added a commit
to ntppool/monitor
that referenced
this issue
Jun 3, 2023
(rather than going through the options for high availability, the SRV lookup just replaced the hostname that it connects to. Worse the SRV lookup is done on every request, ignoring the connection cache?) hashicorp/vault#5540 hashicorp/vault-client-go#183
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The default port number of https scheme is 443. But Vault tries to contact DNS SRV record if the port is missing in https URI.
vault/api/client.go
Lines 591 to 600 in 18deb2d
Note that Go net/url.Parse leaves Port to empty string if port number is missing even if scheme is well known (e.g., https or http).
Because of this, Vault hammers DNS each time it connects to server. To workaround it, we have to specify port number explicitly just like https://example.com:443. But we usually omit the port number if it is the default one.
Because we know that the default https port number is 443 (see https://tools.ietf.org/html/rfc7230#section-2.7.2), it is not necessary to contact DNS to get SRV record. Instead it would be very nice for Vault to resolve default port number by itself without contacting DNS just like Go HTTP client does:
To Reproduce
Expected behavior
Vault should not contact DNS if URI scheme is well known (https or http) and port number is missing in URI, and instead just use default port number.
Environment:
vault status
):vault version
): Vault v0.11.3 ('fb601237bfbe4bc16ff679f642248ee8a86e627b')Vault server configuration file(s):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: