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

InvalidCertificateServers_CertificateValidationDisabled_Succeeds could not resolve expired.badssl.com #63224

Open
danmoseley opened this issue Dec 30, 2021 · 4 comments
Labels
area-System.Net.Http test-enhancement Improvements of test source code
Milestone

Comments

@danmoseley
Copy link
Member

Looks like badssl.com wasn't available for a period of time. if there's already an issue suggesting we maintain our own endpoint, perhaps this could be duped.

BTW since presumably ERROR_WINHTTP_NAME_NOT_RESOLVED is a very common code, perhaps it should have a prettier custom message here...

    System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.InvalidCertificateServers_CertificateValidationDisabled_Succeeds(url: "https://expired.badssl.com/") [FAIL]
      System.Net.Http.HttpRequestException : An error occurred while sending the request.
      ---- System.Net.Http.WinHttpException : Error 12007 calling WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, 'No se pudo resolver el nombre de servidor o su direcci�n'.
      Stack Trace:
        /_/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs(527,0): at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
        /_/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AcceptAllCerts.cs(101,0): at System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.InvalidCertificateServers_CertificateValidationDisabled_Succeeds(String url)
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Private.CoreLib/src/System/Environment.cs(210,0): at System.Environment.get_StackTrace()
        /_/src/libraries/Common/src/System/Runtime/ExceptionServices/ExceptionStackTrace.cs(22,0): at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Exception exception)
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpException.cs(58,0): at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error, String nameOfCalledFunction)
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs(335,0): at System.Net.Http.WinHttpRequestCallback.OnRequestError(WinHttpRequestState state, WINHTTP_ASYNC_RESULT asyncResult)
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs(102,0): at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr handle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength)
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs(46,0): at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength)
        --- End of stack trace from AddCurrentStack ---
        /_/src/libraries/Common/src/System/Threading/Tasks/RendezvousAwaitable.cs(62,0): at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs(957,0): at System.Net.Http.WinHttpHandler.StartRequestAsync(WinHttpRequestState state)
@ghost
Copy link

ghost commented Dec 30, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Looks like badssl.com wasn't available for a period of time. if there's already an issue suggesting we maintain our own endpoint, perhaps this could be duped.

BTW since presumably ERROR_WINHTTP_NAME_NOT_RESOLVED is a very common code, perhaps it should have a prettier custom message here...

    System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.InvalidCertificateServers_CertificateValidationDisabled_Succeeds(url: "https://expired.badssl.com/") [FAIL]
      System.Net.Http.HttpRequestException : An error occurred while sending the request.
      ---- System.Net.Http.WinHttpException : Error 12007 calling WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, 'No se pudo resolver el nombre de servidor o su direcci�n'.
      Stack Trace:
        /_/src/libraries/System.Net.Http/src/System/Net/Http/HttpClient.cs(527,0): at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
        /_/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.AcceptAllCerts.cs(101,0): at System.Net.Http.Functional.Tests.HttpClientHandler_DangerousAcceptAllCertificatesValidator_Test.InvalidCertificateServers_CertificateValidationDisabled_Succeeds(String url)
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Private.CoreLib/src/System/Environment.cs(210,0): at System.Environment.get_StackTrace()
        /_/src/libraries/Common/src/System/Runtime/ExceptionServices/ExceptionStackTrace.cs(22,0): at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Exception exception)
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpException.cs(58,0): at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error, String nameOfCalledFunction)
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs(335,0): at System.Net.Http.WinHttpRequestCallback.OnRequestError(WinHttpRequestState state, WINHTTP_ASYNC_RESULT asyncResult)
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs(102,0): at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr handle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength)
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs(46,0): at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength)
        --- End of stack trace from AddCurrentStack ---
        /_/src/libraries/Common/src/System/Threading/Tasks/RendezvousAwaitable.cs(62,0): at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
        /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs(957,0): at System.Net.Http.WinHttpHandler.StartRequestAsync(WinHttpRequestState state)
Author: danmoseley
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Dec 30, 2021
@wfurt
Copy link
Member

wfurt commented Dec 30, 2021

It resolves now but I agree we should look into reducing external dependencies. We now have ability to generate certificate chains in tests (still unstable on macOS).
Alternatively we can use containers from enterprise auth setup - but that is getting broken on regular cadence because of ongoing build changes ;(

@wfurt wfurt added the test-enhancement Improvements of test source code label Dec 30, 2021
@karelz karelz added this to the Future milestone Jan 4, 2022
@karelz karelz removed the untriaged New issue has not been triaged by the area owner label Jan 4, 2022
@karelz
Copy link
Member

karelz commented Jan 4, 2022

Triage:

  • We would need either docker image with badssl.com-like functionality.
  • Or we could rewrite the tests to use on-the-fly generated certificates, which should be now possible.

@ManickaP
Copy link
Member

ManickaP commented Apr 2, 2022

badssl has been down again lately, causing many failure in outerloop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net.Http test-enhancement Improvements of test source code
Projects
None yet
Development

No branches or pull requests

4 participants