-
Notifications
You must be signed in to change notification settings - Fork 246
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
Add support for using HTTP/2 & possibly HTTP/3 as well instead of only HTTP/1.1 #2674
Comments
Thanks for raising this @Eagle3386 I believe the latest version of the SDK should be making HTTP/2 requests and downgrading the same in the scenario where is not supported. Any chance you can confirm if you are seeing something different from your end? |
@andrueastman sure, there you go: NuGet-Packages are Despite setting several items to logging level The // … code left out for brevity…
var configuration = builder.Configuration;
var isNonProduction = !builder.Environment.IsProduction();
// … code left out for brevity…
.AddAuthentication()
.AddMicrosoftIdentityWebApi(options =>
{
LogCompleteSecurityArtifact = ShowPII = isNonProduction;
configuration.Bind(Constants.AzureAdB2C, options);
options.TokenValidationParameters = new()
{
// … code left out for brevity…
LogValidationExceptions = false
};
},
options => configuration.Bind(Constants.AzureAdB2C, options),
subscribeToJwtBearerMiddlewareDiagnosticsEvents: isNonProduction)
.EnableTokenAcquisitionToCallDownstreamApi(options =>
{
// … code left out for brevity…
options.EnablePiiLogging = isNonProduction;
options.LogLevel = isNonProduction ? LogLevel.Always : LogLevel.Info;
})
.AddMicrosoftGraphAppOnly(_ =>
new(
new Azure.Identity.ClientSecretCredential(
configuration[$"{Constants.AzureAdB2C}:{nameof(MicrosoftIdentityOptions.TenantId)}"],
clientId,
clientSecret,
new()
{
Diagnostics =
{
IsAccountIdentifierLoggingEnabled = isNonProduction,
IsDistributedTracingEnabled = isNonProduction,
IsLoggingContentEnabled = isNonProduction,
IsLoggingEnabled = isNonProduction,
IsTelemetryEnabled = isNonProduction
},
IsUnsafeSupportLoggingEnabled = isNonProduction
})))
.AddInMemoryTokenCaches(options =>
options.AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(isNonProduction ? 14 : 90)) // 14 = Default
// … code left out for brevity… |
Thanks for getting back @Eagle3386 I believe the screenshot you as showing is the HttpClient property here https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.defaultrequestversion?view=net-8.0.. This doesn't apply to the SDK as the SDK makes calls using the The SDK however by default creates HttpRequestMessage instance with the version set to 2.0 as seen at https://github.com/microsoft/kiota-dotnet/blob/427e3ff3c7517f68d395e1591be127f29803f7c8/src/http/httpClient/HttpClientRequestAdapter.cs#L625 Any chance you can try using the guidance at the link below to use the instrumentation in HttpClient to see what requests are made? |
@andrueastman That's not really helpful, because although I
there's simply no log visible anywhere. I expected (almost) "copy & paste"-ready instructions, so I can finally show that the SDK doesn't work as advertised (or does & I'm simply blind). Yet, I'm dealing with cumbersome steps to even get debug logs going - almost a nightmare of a developer experience, I've got to admit. |
Is your feature request related to a problem? Please describe the problem.
AFAICT, the
GraphServiceClient
uses HTTP/1.1 & there's no chance of instructing it to use HTTP/2 (or even HTTP/3) instead - at least not without rewriting basically half of the client.Describe the solution you'd like.
Please allow configuration of the HTTP version used, preferably by providing an optional argument that's passed down to the
HttpClientHandler
'sHttpVersion
& defaulting to HTTP/1.1.Additional context?
No response
The text was updated successfully, but these errors were encountered: