Skip to content
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

azcore: add support for dropping to HTTP/1 and/or TLS renegotiation in the default transport policy #19469

Closed
jhendrixMSFT opened this issue Nov 1, 2022 · 6 comments
Assignees
Labels
Azure.Core feature-request This issue requires a new behavior in the product in order be resolved.

Comments

@jhendrixMSFT
Copy link
Member

Some endpoints don't support HTTP/2 and/or require TLS renegotiation to be enabled. We can update the default transport policy to detect when these are required and react accordingly.

@jhendrixMSFT jhendrixMSFT self-assigned this Nov 1, 2022
@jhendrixMSFT
Copy link
Member Author

One place where this might get squirrely is callers provider a custom transporter (e.g. httptrace) which would remove this logic. In that case, clients would then be broken. We might need to export this policy so that callers can wrap it with a tracing implementation as needed.

@RickWinter
Copy link
Member

Adding a workaround that can be used to configure a custom http client until an official fix is available, Thanks @chlowell for providing

import (
       "crypto/tls"
       "net/http"

       "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
       "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
)

opts := arm.ClientOptions{ClientOptions: policy.ClientOptions{
       Transport: &http.Client{
              Transport: &http.Transport{
                     TLSClientConfig: &tls.Config{
                           Renegotiation: tls.RenegotiateFreelyAsClient,
                     },
              },
       },
}}
client, err := armsubscription.NewSubscriptionsClient(cred, &opts)

@RickWinter RickWinter added the feature-request This issue requires a new behavior in the product in order be resolved. label Dec 15, 2022
@YoshicoppensE61
Copy link

There are multiple people still suffering from this in the issue mentioned above Azure/terraform-provider-azapi#184

@jhendrixMSFT
Copy link
Member Author

After further investigation we've concluded that we will enable TLS renegotiation by default.

For HTTP/1.1, we will likely disable HTTP/2 upgrades for ARM clients only.

@jhendrixMSFT
Copy link
Member Author

The HTTP/1.1 issue appears to be a red herring (bad URL was provided).

@jhendrixMSFT
Copy link
Member Author

TLS renegotiation has been enabled in [email protected]

@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core feature-request This issue requires a new behavior in the product in order be resolved.
Projects
None yet
Development

No branches or pull requests

3 participants