-
-
Notifications
You must be signed in to change notification settings - Fork 8.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
[🚀 Feature]: [dotnet] Expose HttpClient initialization in HttpCommandExecutor to make it possible for overriding #15280
Comments
@nvborisenko, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
It will be amazing to implement it and include into upcoming release for our Appium friends. @RenderMichael do you have any objections about proposed API? |
I think the goal is a good one. An alternative API would be to modify the existing HttpClient and HttpClientHandler: public class MyHttpCommandExecutor : HttpCommandExecutor
{
protected override void ModifyHttpClientHandler(HttpClientHandler handler)
{
httpHandler.ServerCertificateCustomValidationCallback =
HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
}
protected override void ModifyHttpClient(HttpClient client)
{
// anything else here
}
} This helps ensure nobody misses calling |
|
Done, thanks team. |
Feature and motivation
HttpCommandExecutor
entirely closed for any overriding to createHttpClient
:selenium/dotnet/src/webdriver/Remote/HttpCommandExecutor.cs
Line 224 in 6836d0a
It will be good to make it
protected virtual
. Proposed API:It also exposes initialization of
HttpClientHandler
to make it possible to customize it, like ignoring certificate validation (appium/dotnet-client#455).Usage example
The text was updated successfully, but these errors were encountered: