Open stephteo opened 1 year ago
Hi @stephteo thanks for creating the feature request. We can't guarantee that the team would implement this, it would require some further investigation. In the meantime we encourage others to 👍 this issue and share other use cases if they are also interested in this.
Describe the feature
There are cases where traffic on IPv6 is blocked (e.g. using a particular VPN client) and it would be useful to be able to toggle this flag off or have some way to prefer IPv4 over IPv6 for domain resolution.
Otherwise Boto3 should try to get a connection to IPv4 and IPv6 in parallel instead of serially right now (IPv6 -> IPv4) as some AWS services (e.g. "secretsmanager") are configured for dual-stack endpoints.
Use Case
If a user's router and device are configured to have IPv6 enabled, the following:
will fail to get an HTTPS connection to the requested IPv6 domain when getting an AWS service client (e.g. "secretsmanager") and the fallback to IPv4 only happens after the first retry to connect after the
connect_timeout
time. This can lead to a long waiting time to get a response based on theconnect_timeout
. It is not ideal to simply reduce theconnect_timeout
to get around this and just fallback faster to IPv4. Consequently, as a workaround, we have had to temporarily disable the flagurllib3.util.connection.HAS_IPV6 = False
so that IPv4 domain resolution is the first one used.Proposed Solution
The best solution will be if boto3 tries to get a connection to IPv4 and IPv6 at the same time and then this workaround would not be needed.
Other Information
No response
Acknowledgements
SDK version used
1.22.7
Environment details (OS name and version, etc.)
MacOS Monterey 12.6.3