Skip to content

Conversation

@wjordan
Copy link
Contributor

@wjordan wjordan commented May 17, 2022

Fixes #248 by changing uri.host to uri.hostname in Vault::PersistentHTTP.

The underlying issue is that URI#host is the incorrect method to use for passing a hostname to Net::HTTP, because it doesn't handle IPv6 addresses correctly:

Since IPv6 addresses are wrapped with brackets in URIs, this method returns IPv6 addresses wrapped with brackets. This form is not appropriate to pass to socket methods such as TCPSocket.open. If unwrapped host names are required, use the hostname method.

Note: this module appears to be vendored from drbrain/net-http-persistent, which already included a fix for this issue (drbrain/net-http-persistent#76, drbrain/net-http-persistent#82, drbrain/net-http-persistent@aa112b2) in its latest release.

Copy link
Contributor

@swenson swenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@swenson swenson merged commit 9344ae2 into hashicorp:master Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vault.address does not support IPv6 addresses

3 participants