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

[Android] Some System.Net.Security tests are failing #68206

Open
simonrozsival opened this issue Apr 19, 2022 · 6 comments
Open

[Android] Some System.Net.Security tests are failing #68206

simonrozsival opened this issue Apr 19, 2022 · 6 comments
Labels
area-System.Net.Security disabled-test The test is disabled in source code against the issue os-android
Milestone

Comments

@simonrozsival
Copy link
Member

simonrozsival commented Apr 19, 2022

The following System.Net.Security tests are failing on Android:

  • CertificateValidationClientServer.CertificateSelectionCallback_DelayedCertificate_OK
  • ServerAsyncAuthenticateTest.ServerAsyncAuthenticate_MismatchProtocols_Fails
  • SslStreamAlpnTest_Async.SslStream_StreamToStream_Alpn_NonMatchingProtocols_Fail
  • SslStreamAlpnTest_Sync.SslStream_StreamToStream_Alpn_NonMatchingProtocols_Fail
  • SslStreamNetworkStreamTest.SslStream_TargetHostName_Succeeds
  • SslStreamNetworkStreamTest.SslStream_ServerUntrustedCaWithCustomTrust_OK
  • SslStreamNetworkStreamTest.SslStream_ClientCertificate_SendsChain
  • SslStreamNetworkStreamTest.SslStream_ClientCertificateContext_SendsChain
  • SslStreamSniTest.SslStream_ClientSendsSNIServerReceives_Ok
  • SslStreamSniTest.SslStream_ServerCallbackNotSet_UsesLocalCertificateSelection
  • SslStreamSniTest.UnencodedHostName_ValidatesCertificate
  • TransportContextTest.TransportContext_ConnectToServerWithSsl_GetExpectedChannelBindings
@ghost
Copy link

ghost commented Apr 19, 2022

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Issue Details

The following System.Net.Security tests are failing on Android:

  • CertificateValidationClientServer.CertificateSelectionCallback_DelayedCertificate_OK
  • ClientDefaultEncryptionTest.ClientDefaultEncryption_ServerRequireEncryption_ConnectWithEncryption
  • ClientDefaultEncryptionTest.ClientDefaultEncryption_ServerAllowNoEncryption_ConnectWithEncryption
  • NegotiatedCipherSuiteTest.CipherSuitesPolicy_AllowOneOnOneSideTls13_Success
  • NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsLowerThanTls13_ShouldMatchTheProtocol
  • NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13
  • ServerAllowNoEncryptionTest.ServerAllowNoEncryption_ClientAllowNoEncryption_ConnectWithEncryption
  • ServerAllowNoEncryptionTest.ServerAllowNoEncryption_ClientRequireEncryption_ConnectWithEncryption
  • SslClientAuthenticationOptionsTestBase_Sync.ClientOptions_ServerOptions_NotMutatedDuringAuthentication
  • SslStreamCredentialCacheTest.SslStream_SameCertUsedForClientAndServer_Ok
  • SslStreamStreamToStreamTest_SyncParameters.Read_CorrectlyUnlocksAfterFailure
  • SslStreamStreamToStreamTest_SyncParameters.SslStream_StreamToStream_Authentication_Success
  • SslStreamStreamToStreamTest_SyncParameters.Write_CorrectlyUnlocksAfterFailure
  • SslStreamStreamToStreamTest_SyncParameters.Write_InvokedSynchronously
  • SslStreamStreamToStreamTest_SyncSslOptions.Write_InvokedSynchronously
  • SyncSslStreamSystemDefaultTest.ClientAndServer_OneOrBothUseDefault_Ok
  • TransportContextTest.TransportContext_ConnectToServerWithSsl_GetExpectedChannelBindings

The tests fail because of Interop.AndroidCrypto.SslException being thrown. Sample stack trace:

[FAIL] System.Net.Security.Tests.NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13   Test name: System.Net.Security.Tests.NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13
  :    Assembly:  [System.Net.Security.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
  :    Exception messages: System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
  : ---- Interop+AndroidCrypto+SslException : Exception of type 'Interop+AndroidCrypto+SslException' was thrown.   Exception stack traces:    at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__166`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
  :    at System.Net.Security.Tests.NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13() in /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNegotiatedCipherSuiteTest.cs:line 85
  :    at System.Reflection.RuntimeMethodInfo.InvokeNonEmitUnsafe(Object obj, IntPtr* byrefParameters, Span`1 argsForTemporaryMonoSupport, BindingFlags invokeAttr)
  : ----- Inner Stack Trace -----
Author: simonrozsival
Assignees: -
Labels:

os-android

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Net.Security untriaged New issue has not been triaged by the area owner labels Apr 19, 2022
@ghost
Copy link

ghost commented Apr 19, 2022

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

Issue Details

The following System.Net.Security tests are failing on Android:

  • CertificateValidationClientServer.CertificateSelectionCallback_DelayedCertificate_OK
  • ClientDefaultEncryptionTest.ClientDefaultEncryption_ServerRequireEncryption_ConnectWithEncryption
  • ClientDefaultEncryptionTest.ClientDefaultEncryption_ServerAllowNoEncryption_ConnectWithEncryption
  • NegotiatedCipherSuiteTest.CipherSuitesPolicy_AllowOneOnOneSideTls13_Success
  • NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsLowerThanTls13_ShouldMatchTheProtocol
  • NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13
  • ServerAllowNoEncryptionTest.ServerAllowNoEncryption_ClientAllowNoEncryption_ConnectWithEncryption
  • ServerAllowNoEncryptionTest.ServerAllowNoEncryption_ClientRequireEncryption_ConnectWithEncryption
  • SslClientAuthenticationOptionsTestBase_Sync.ClientOptions_ServerOptions_NotMutatedDuringAuthentication
  • SslStreamCredentialCacheTest.SslStream_SameCertUsedForClientAndServer_Ok
  • SslStreamStreamToStreamTest_SyncParameters.Read_CorrectlyUnlocksAfterFailure
  • SslStreamStreamToStreamTest_SyncParameters.SslStream_StreamToStream_Authentication_Success
  • SslStreamStreamToStreamTest_SyncParameters.Write_CorrectlyUnlocksAfterFailure
  • SslStreamStreamToStreamTest_SyncParameters.Write_InvokedSynchronously
  • SslStreamStreamToStreamTest_SyncSslOptions.Write_InvokedSynchronously
  • SyncSslStreamSystemDefaultTest.ClientAndServer_OneOrBothUseDefault_Ok
  • TransportContextTest.TransportContext_ConnectToServerWithSsl_GetExpectedChannelBindings

The tests fail because of Interop.AndroidCrypto.SslException being thrown. Sample stack trace:

[FAIL] System.Net.Security.Tests.NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13   Test name: System.Net.Security.Tests.NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13
  :    Assembly:  [System.Net.Security.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]
  :    Exception messages: System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
  : ---- Interop+AndroidCrypto+SslException : Exception of type 'Interop+AndroidCrypto+SslException' was thrown.   Exception stack traces:    at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__166`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
  :    at System.Net.Security.Tests.NegotiatedCipherSuiteTest.NegotiatedCipherSuite_SslProtocolIsTls13_ShouldBeTls13() in /_/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNegotiatedCipherSuiteTest.cs:line 85
  :    at System.Reflection.RuntimeMethodInfo.InvokeNonEmitUnsafe(Object obj, IntPtr* byrefParameters, Span`1 argsForTemporaryMonoSupport, BindingFlags invokeAttr)
  : ----- Inner Stack Trace -----
Author: simonrozsival
Assignees: -
Labels:

area-System.Net.Security, os-android, untriaged

Milestone: -

@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Apr 21, 2022
@steveisok steveisok added this to the 7.0.0 milestone Apr 21, 2022
@maraf
Copy link
Member

maraf commented Jun 9, 2022

Also System.Net.Security.Tests.CertificateValidationRemoteServer.ConnectWithRevocation_WithCallback from #20220604.1

System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
---- Interop+AndroidCrypto+SslException : Exception of type 'Interop+AndroidCrypto+SslException' was thrown.
   at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__144`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
   at System.Threading.Tasks.TaskTimeoutExtensions.GetRealException(Task task) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 120
--- End of stack trace from previous location ---
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 90
   at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks, Int32 millisecondsTimeout) in /_/src/libraries/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs:line 55
   at System.Net.Security.Tests.CertificateValidationRemoteServer.ConnectWithRevocation_WithCallback_Core(X509RevocationMode revocationMode, Nullable`1 offlineContext) in /_/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs:line 198
   at System.Net.Security.Tests.CertificateValidationRemoteServer.ConnectWithRevocation_WithCallback_Core(X509RevocationMode revocationMode, Nullable`1 offlineContext) in /_/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs:line 199
   at System.Net.Security.Tests.CertificateValidationRemoteServer.ConnectWithRevocation_WithCallback_Core(X509RevocationMode revocationMode, Nullable`1 offlineContext) in /_/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs:line 199
   at System.Net.Security.Tests.CertificateValidationRemoteServer.ConnectWithRevocation_WithCallback_Core(X509RevocationMode revocationMode, Nullable`1 offlineContext) in /_/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs:line 199
   at System.Net.Security.Tests.CertificateValidationRemoteServer.ConnectWithRevocation_WithCallback_Core(X509RevocationMode revocationMode, Nullable`1 offlineContext) in /_/src/libraries/System.Net.Security/tests/FunctionalTests/CertificateValidationRemoteServer.cs:line 199
--- End of stack trace from previous location ---
----- Inner Stack Trace -----

@maraf maraf added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jun 9, 2022
@maraf
Copy link
Member

maraf commented Jun 9, 2022

cc @karelz

@maraf
Copy link
Member

maraf commented Jun 9, 2022

Moved to a separate issue as dug-out more details #70469

@maraf maraf removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jun 9, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 4, 2022
@simonrozsival simonrozsival self-assigned this Jul 11, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 18, 2022
@simonrozsival
Copy link
Member Author

Most of the failing tests were fixed in #71385 but there are a few that will require further investigation and are possibly caused by missing functionality in Android PAL (#45741)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net.Security disabled-test The test is disabled in source code against the issue os-android
Projects
None yet
Development

No branches or pull requests

4 participants