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

SslStreamNetworkStreamTest failing intermitently on OSX #46837

Closed
eerhardt opened this issue Jan 11, 2021 · 9 comments · Fixed by #66393
Closed

SslStreamNetworkStreamTest failing intermitently on OSX #46837

eerhardt opened this issue Jan 11, 2021 · 9 comments · Fixed by #66393
Assignees
Labels
area-System.Net.Security disabled-test The test is disabled in source code against the issue os-mac-os-x macOS aka OSX test-run-core Test failures in .NET Core test runs
Milestone

Comments

@eerhardt
Copy link
Member

eerhardt commented Jan 11, 2021

See the logs here:

https://dev.azure.com/dnceng/public/_build/results?buildId=945417&view=logs&j=c6f8dc49-92a1-5760-c098-ba97b8142bfb&t=22b0078b-0469-5ba6-8725-2121fdbae049&l=73

https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-46786-merge-dccc925d8d224a72ae/System.Net.Security.Tests/console.8a016bf1.log?sv=2019-07-07&se=2021-01-31T21%3A35%3A41Z&sr=c&sp=rl&sig=s450sAj02mJX6juyepBSL48rnUMYeIe%2BD8VFbS5YgfM%3D

/private/tmp/helix/working/BCF90A3E/w/A4D60969/e /private/tmp/helix/working/BCF90A3E/w/A4D60969/e
  Discovering: System.Net.Security.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Net.Security.Tests (found 273 of 453 test cases)
  Starting:    System.Net.Security.Tests (parallel test collections = on, max threads = 4)
    System.Net.Security.Tests.ServerRequireEncryptionTest.ServerRequireEncryption_ClientNoEncryption_NoConnect [SKIP]
      Condition(s) not met: "SupportsNullEncryption"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_SelfSignedClientEKUClientAuth_Ok [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_ServerEKUClientAuth_Fails [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_ClientEKUServerAuth_Fails [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_NoEKUServerAuth_Ok [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_NoEKUClientAuth_Ok [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.CipherSuitesPolicy_OnlyTls13CipherSuiteAllowedButChosenProtocolsDoesNotAllowIt_Fails [SKIP]
      Condition(s) not met: "CipherSuitesPolicyAndTls13Supported"
    System.Net.Security.Tests.ServerNoEncryptionTest.ServerNoEncryption_ClientAllowNoEncryption_ConnectWithNoEncryption [SKIP]
      Condition(s) not met: "SupportsNullEncryption"
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13 [SKIP]
      Condition(s) not met: "Tls13Supported"
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.CipherSuitesPolicy_AllowOneOnOneSideTls13_Success [SKIP]
      Condition(s) not met: "CipherSuitesPolicyAndTls13Supported"
    System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(customCallback: True) [FAIL]
      Assert.Contains() Failure
      Not found: RemoteCertificateValidationCallback
      In value:  Authentication failed, see inner exception.
      Stack Trace:
        /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(321,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(Boolean customCallback)
        --- End of stack trace from previous location ---
    System.Net.Security.Tests.ServerAllowNoEncryptionTest.ServerAllowNoEncryption_ClientNoEncryption_ConnectWithNoEncryption [SKIP]
      Condition(s) not met: "SupportsNullEncryption"
    System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(customCallback: False) [FAIL]
      Assert.Contains() Failure
      Not found: PartialChain
      In value:  Authentication failed, see inner exception.
      Stack Trace:
        /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(321,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(Boolean customCallback)
        --- End of stack trace from previous location ---
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.Tls13IsSupported_GetValue_ReturnsTrue [SKIP]
      Condition(s) not met: "IsKnownPlatformSupportingTls13"
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.CipherSuitesPolicy_OnlyTls13CipherSuiteAllowedOtherSideDoesNotAllowTls13_Fails [SKIP]
      Condition(s) not met: "CipherSuitesPolicyAndTls13Supported"
    System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(usePartialChain: True) [FAIL]
      System.AggregateException : One or more errors occurred. (One or more errors occurred. (Authentication failed, see inner exception.)) (One or more errors occurred. (Authentication failed, see inner exception.))
      ---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
      -------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ------------ Interop+AppleCrypto+SslException : bad protocol version
      ---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
      -------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ------------ Interop+AppleCrypto+SslException : One or more parameters passed to a function were not valid.
      Stack Trace:
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(122,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(84,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout)
        /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(274,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(Boolean usePartialChain)
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace #1 (System.AggregateException) -----
        
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
        ----- Inner Stack Trace -----
        
        ----- Inner Stack Trace #2 (System.AggregateException) -----
        
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(96,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        ----- Inner Stack Trace -----
        /_/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs(273,0): at Interop.AppleCrypto.SslSetCertificate(SafeSslHandle sslHandle, IntPtr[] certChainPtrs)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(345,0): at System.Net.SafeDeleteSslContext.SetCertificate(SafeSslHandle sslContext, SslStreamCertificateContext context)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(132,0): at System.Net.SafeDeleteSslContext.CreateSslContext(SafeFreeSslCredentials credential, Boolean isServer)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(86,0): at System.Net.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.OSX.cs(236,0): at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
    System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(usePartialChain: False) [FAIL]
      System.AggregateException : One or more errors occurred. (One or more errors occurred. (Authentication failed, see inner exception.)) (One or more errors occurred. (Authentication failed, see inner exception.))
      ---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
      -------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ------------ Interop+AppleCrypto+SslException : bad protocol version
      ---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
      -------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ------------ Interop+AppleCrypto+SslException : One or more parameters passed to a function were not valid.
      Stack Trace:
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(122,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(84,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout)
        /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(274,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(Boolean usePartialChain)
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace #1 (System.AggregateException) -----
        
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
        ----- Inner Stack Trace -----
        
        ----- Inner Stack Trace #2 (System.AggregateException) -----
        
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(96,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        ----- Inner Stack Trace -----
        /_/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs(273,0): at Interop.AppleCrypto.SslSetCertificate(SafeSslHandle sslHandle, IntPtr[] certChainPtrs)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(345,0): at System.Net.SafeDeleteSslContext.SetCertificate(SafeSslHandle sslContext, SslStreamCertificateContext context)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(132,0): at System.Net.SafeDeleteSslContext.CreateSslContext(SafeFreeSslCredentials credential, Boolean isServer)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(86,0): at System.Net.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.OSX.cs(236,0): at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
  Finished:    System.Net.Security.Tests
=== TEST EXECUTION SUMMARY ===
   System.Net.Security.Tests  Total: 4703, Errors: 0, Failed: 4, Skipped: 13, Time: 69.066s

Runfo Tracking Issue: SslStreamNetworkStreamTest_Throws failing on OSX

Build Definition Kind Run Name Console Core Dump Test Results Run Client
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-(Centos.7.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-helix-20210714125435-dde38af console.log runclient.py
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-(Centos.7.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-helix-20210714125435-dde38af console.log runclient.py
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-(Centos.7.Amd64.Open)Ubuntu.1604.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-mlnet-helix-20210714125435-dde38af console.log runclient.py
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-RedHat.7.Amd64.Open console.log runclient.py
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-RedHat.7.Amd64.Open console.log runclient.py
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-RedHat.7.Amd64.Open console.log runclient.py
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-(Debian.10.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-20210304164434-56c6673 console.log runclient.py
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-(Debian.10.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-20210304164434-56c6673 console.log runclient.py
1610706 runtime PR 65239 net7.0-Linux-Debug-x64-Mono_release-(Debian.10.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-20210304164434-56c6673 console.log runclient.py

Build Result Summary

Day Hit Count Week Hit Count Month Hit Count
0 0 1
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Net.Security untriaged New issue has not been triaged by the area owner labels Jan 11, 2021
@ghost
Copy link

ghost commented Jan 11, 2021

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

Issue Details

See the logs here:

https://dev.azure.com/dnceng/public/_build/results?buildId=945417&view=logs&j=c6f8dc49-92a1-5760-c098-ba97b8142bfb&t=22b0078b-0469-5ba6-8725-2121fdbae049&l=73

https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-46786-merge-dccc925d8d224a72ae/System.Net.Security.Tests/console.8a016bf1.log?sv=2019-07-07&se=2021-01-31T21%3A35%3A41Z&sr=c&sp=rl&sig=s450sAj02mJX6juyepBSL48rnUMYeIe%2BD8VFbS5YgfM%3D

/private/tmp/helix/working/BCF90A3E/w/A4D60969/e /private/tmp/helix/working/BCF90A3E/w/A4D60969/e
  Discovering: System.Net.Security.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Net.Security.Tests (found 273 of 453 test cases)
  Starting:    System.Net.Security.Tests (parallel test collections = on, max threads = 4)
    System.Net.Security.Tests.ServerRequireEncryptionTest.ServerRequireEncryption_ClientNoEncryption_NoConnect [SKIP]
      Condition(s) not met: "SupportsNullEncryption"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_SelfSignedClientEKUClientAuth_Ok [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_ServerEKUClientAuth_Fails [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_ClientEKUServerAuth_Fails [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_NoEKUServerAuth_Ok [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.SslStreamEKUTest.SslStream_NoEKUClientAuth_Ok [SKIP]
      Condition(s) not met: "IsRootCertificateInstalled"
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.CipherSuitesPolicy_OnlyTls13CipherSuiteAllowedButChosenProtocolsDoesNotAllowIt_Fails [SKIP]
      Condition(s) not met: "CipherSuitesPolicyAndTls13Supported"
    System.Net.Security.Tests.ServerNoEncryptionTest.ServerNoEncryption_ClientAllowNoEncryption_ConnectWithNoEncryption [SKIP]
      Condition(s) not met: "SupportsNullEncryption"
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13 [SKIP]
      Condition(s) not met: "Tls13Supported"
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.CipherSuitesPolicy_AllowOneOnOneSideTls13_Success [SKIP]
      Condition(s) not met: "CipherSuitesPolicyAndTls13Supported"
    System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(customCallback: True) [FAIL]
      Assert.Contains() Failure
      Not found: RemoteCertificateValidationCallback
      In value:  Authentication failed, see inner exception.
      Stack Trace:
        /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(321,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(Boolean customCallback)
        --- End of stack trace from previous location ---
    System.Net.Security.Tests.ServerAllowNoEncryptionTest.ServerAllowNoEncryption_ClientNoEncryption_ConnectWithNoEncryption [SKIP]
      Condition(s) not met: "SupportsNullEncryption"
    System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(customCallback: False) [FAIL]
      Assert.Contains() Failure
      Not found: PartialChain
      In value:  Authentication failed, see inner exception.
      Stack Trace:
        /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(321,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(Boolean customCallback)
        --- End of stack trace from previous location ---
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.Tls13IsSupported_GetValue_ReturnsTrue [SKIP]
      Condition(s) not met: "IsKnownPlatformSupportingTls13"
    System.Net.Security.Tests.NegotiatedCipherSuiteTest.CipherSuitesPolicy_OnlyTls13CipherSuiteAllowedOtherSideDoesNotAllowTls13_Fails [SKIP]
      Condition(s) not met: "CipherSuitesPolicyAndTls13Supported"
    System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(usePartialChain: True) [FAIL]
      System.AggregateException : One or more errors occurred. (One or more errors occurred. (Authentication failed, see inner exception.)) (One or more errors occurred. (Authentication failed, see inner exception.))
      ---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
      -------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ------------ Interop+AppleCrypto+SslException : bad protocol version
      ---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
      -------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ------------ Interop+AppleCrypto+SslException : One or more parameters passed to a function were not valid.
      Stack Trace:
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(122,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(84,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout)
        /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(274,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(Boolean usePartialChain)
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace #1 (System.AggregateException) -----
        
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
        ----- Inner Stack Trace -----
        
        ----- Inner Stack Trace #2 (System.AggregateException) -----
        
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(96,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        ----- Inner Stack Trace -----
        /_/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs(273,0): at Interop.AppleCrypto.SslSetCertificate(SafeSslHandle sslHandle, IntPtr[] certChainPtrs)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(345,0): at System.Net.SafeDeleteSslContext.SetCertificate(SafeSslHandle sslContext, SslStreamCertificateContext context)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(132,0): at System.Net.SafeDeleteSslContext.CreateSslContext(SafeFreeSslCredentials credential, Boolean isServer)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(86,0): at System.Net.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.OSX.cs(236,0): at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
    System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(usePartialChain: False) [FAIL]
      System.AggregateException : One or more errors occurred. (One or more errors occurred. (Authentication failed, see inner exception.)) (One or more errors occurred. (Authentication failed, see inner exception.))
      ---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
      -------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ------------ Interop+AppleCrypto+SslException : bad protocol version
      ---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
      -------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ------------ Interop+AppleCrypto+SslException : One or more parameters passed to a function were not valid.
      Stack Trace:
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(122,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(84,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout)
        /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(274,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(Boolean usePartialChain)
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace #1 (System.AggregateException) -----
        
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
        ----- Inner Stack Trace -----
        
        ----- Inner Stack Trace #2 (System.AggregateException) -----
        
        ----- Inner Stack Trace -----
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
        /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs(96,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
        ----- Inner Stack Trace -----
        /_/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs(273,0): at Interop.AppleCrypto.SslSetCertificate(SafeSslHandle sslHandle, IntPtr[] certChainPtrs)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(345,0): at System.Net.SafeDeleteSslContext.SetCertificate(SafeSslHandle sslContext, SslStreamCertificateContext context)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(132,0): at System.Net.SafeDeleteSslContext.CreateSslContext(SafeFreeSslCredentials credential, Boolean isServer)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(86,0): at System.Net.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
        /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.OSX.cs(236,0): at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
  Finished:    System.Net.Security.Tests
=== TEST EXECUTION SUMMARY ===
   System.Net.Security.Tests  Total: 4703, Errors: 0, Failed: 4, Skipped: 13, Time: 69.066s
Author: eerhardt
Assignees: -
Labels:

area-System.Net.Security, untriaged

Milestone: -

@wfurt
Copy link
Member

wfurt commented Jan 12, 2021

I don't see any failure in master branch but I do see one more recent failure in other PR.
I did touch this recently so I'll watch it to see if we get more failures.

@VincentBu
Copy link

VincentBu commented Jan 15, 2021

Failed in job runtime 20210114.72

Failed tests :

System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(usePartialChain: False)
System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(usePartialChain: True)
System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(customCallback: False)
System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(customCallback: True)

net6.0-OSX-Release-x64-Mono_release-OSX.1015.Amd64.Open

Error messages:

System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(customCallback: True)

Assert.Contains() Failure
Not found: RemoteCertificateValidationCallback
In value:  Authentication failed, see inner exception.


Stack trace
   at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(Boolean customCallback) in /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs:line 321
--- End of stack trace from previous location ---
System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(customCallback: False)

Assert.Contains() Failure
Not found: RemoteCertificateValidationCallback
In value:  Authentication failed, see inner exception.


Stack trace
   at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(Boolean customCallback) in /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs:line 321
--- End of stack trace from previous location ---
System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(usePartialChain: False)
System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(usePartialChain: True)

System.AggregateException : One or more errors occurred. (One or more errors occurred. (Authentication failed, see inner exception.)) (One or more errors occurred. (Authentication failed, see inner exception.))
---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
-------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
------------ Interop+AppleCrypto+SslException : bad protocol version
---- System.AggregateException : One or more errors occurred. (Authentication failed, see inner exception.)
-------- System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
------------ Interop+AppleCrypto+SslException : One or more parameters passed to a function were not valid.


Stack trace
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 122
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 84
   at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_OK(Boolean usePartialChain) in /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs:line 274
--- End of stack trace from previous location ---
----- Inner Stack Trace #1 (System.AggregateException) -----

----- Inner Stack Trace -----
   at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext() in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs:line 393
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 96
----- Inner Stack Trace -----

----- Inner Stack Trace #2 (System.AggregateException) -----

----- Inner Stack Trace -----
   at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__171`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext() in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs:line 393
----- Inner Stack Trace -----
   at Interop.AppleCrypto.SslSetCertificate(SafeSslHandle sslHandle, IntPtr[] certChainPtrs) in /_/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs:line 273
   at System.Net.SafeDeleteSslContext.SetCertificate(SafeSslHandle sslContext, SslStreamCertificateContext context) in /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs:line 345
   at System.Net.SafeDeleteSslContext.CreateSslContext(SafeFreeSslCredentials credential, Boolean isServer) in /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs:line 132
   at System.Net.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions) in /_/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs:line 86
   at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.OSX.cs:line 236

@hoyosjs hoyosjs changed the title SslStreamNetworkStreamTest failed on mono OSX SslStreamNetworkStreamTest failing intermitently on OSX Jan 15, 2021
@hoyosjs
Copy link
Member

hoyosjs commented Jan 15, 2021

@wfurt both SslStream_UntrustedCaWithCustomCallback_Throws and SslStream_UntrustedCaWithCustomCallback_OK have become heavy hitters. I've edited the name of the issue as it hits both CoreCLR and Mono.. The namespace System.Name.Security.Tests accounts for a good chunk of red builds in the past two weeks other than the infra failures. I'll be turning these two tests off to unblock CI.

@wfurt
Copy link
Member

wfurt commented Jan 15, 2021

ok. I'll try to reproduce it locally @hoyosjs

@karelz
Copy link
Member

karelz commented Feb 11, 2021

@wfurt do you know if it is new test, or test/product regression introduced "recently"?

@wfurt
Copy link
Member

wfurt commented Feb 11, 2021

Thisis is very recent new test. Linux failures should be improved by #48149. OSX investigation is still pending for macOS @karelz .

@wfurt
Copy link
Member

wfurt commented Feb 12, 2021

It looks like it fails sometimes on server side with

     System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
      ---- Interop+AppleCrypto+SslException : One or more parameters passed to a function were not valid.
      Stack Trace:
        /Users/furt/github/wfurt-ssl/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs(393,0): at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
        /Users/furt/github/wfurt-ssl/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs(351,0): at System.Net.Security.Tests.SslStreamNetworkStreamTest.SslStream_UntrustedCaWithCustomCallback_Throws(Boolean customCallback)
        --- End of stack trace from previous location ---
        ----- Inner Stack Trace -----
        /Users/furt/github/wfurt-ssl/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs(273,0): at Interop.AppleCrypto.SslSetCertificate(SafeSslHandle sslHandle, IntPtr[] certChainPtrs)
        /Users/furt/github/wfurt-ssl/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(345,0): at System.Net.SafeDeleteSslContext.SetCertificate(SafeSslHandle sslContext, SslStreamCertificateContext context)
        /Users/furt/github/wfurt-ssl/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(123,0): at System.Net.SafeDeleteSslContext.CreateSslContext(SafeFreeSslCredentials credential, Boolean isServer)
        /Users/furt/github/wfurt-ssl/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs(40,0): at System.Net.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
        /Users/furt/github/wfurt-ssl/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.OSX.cs(236,0): at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)

it seems like OS does not like one (or more) certificates we passed in.

Let me know if you have any hints how to debug this further @bartonjs @vcsjones. All the pointers look pointrish e.g. similar & high positive value. So far, I can reproduce it only when running in batch.

@karelz karelz added the os-mac-os-x macOS aka OSX label Feb 12, 2021
@aik-jahoda aik-jahoda self-assigned this Feb 18, 2021
@karelz karelz added the test-run-core Test failures in .NET Core test runs label May 4, 2021
@karelz karelz modified the milestones: 6.0.0, Future May 4, 2021
@rzikm rzikm assigned rzikm and unassigned aik-jahoda Mar 9, 2022
rzikm added a commit to rzikm/dotnet-runtime that referenced this issue Mar 9, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Mar 9, 2022
@rzikm
Copy link
Member

rzikm commented Mar 10, 2022

I suspect this has been fixed since disabling the tests (e.g. by #57381). I put up PR which reenables the tests and they seem to pass.

rzikm added a commit that referenced this issue Mar 15, 2022
The underlying issue has been likely fixed by other changes
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 15, 2022
radekdoulik pushed a commit to radekdoulik/runtime that referenced this issue Mar 30, 2022
The underlying issue has been likely fixed by other changes
@karelz karelz modified the milestones: Future, 7.0.0 Apr 8, 2022
@dotnet dotnet locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Security disabled-test The test is disabled in source code against the issue os-mac-os-x macOS aka OSX test-run-core Test failures in .NET Core test runs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants