You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Authentication failed when trying to connect to secure websocket with android 8 #83118
I cant connect to secure websocket(wss), it just writing Unable to connect to the remote server and error Authentication failed, full log is down there, and to unsecure websocket i can connect easily on any android.
When i used android 11 phone it works fine.
I am using library 'WebSocket4Net' which working perfectly in xamarin with all androids.
Steps to Reproduce
Connect to a secure websocket with .NET MAUI APP on android phone with android version 8, tested on both physical phone and emulator.
Or there is my repo where you can test it Repo
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 8, but most likely its all older android versions
Did you find any workaround?
In xamarin, there is SSL/TLS implementation and HttpClient implementation option in project settings, but in .NET MAUI its not or i didnt found it
I tryed copied this from Xamarin project where this websocket works fine on every platform, but its still not working.
Facing the same issue on a non-MAUI Android .NET 6 app with errors like this:
System.Net.WebSockets.WebSocketException (0x80004005): Unable to connect to the remote server
---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
---> Interop+AndroidCrypto+SslException: Exception of type 'Interop+AndroidCrypto+SslException' was thrown.
--- End of inner exception stack trace ---
at System.Net.Security.SslStream.<ForceAuthenticationAsync>d__175`1[[System.Net.Security.AsyncReadWriteAdapter, System.Net.Security, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
Also, in logcat I see the following right before the .NET exception:
W System.err: java.lang.IllegalStateException: Handshake has already been started
W System.err: at com.android.org.conscrypt.OpenSSLEngineImpl.beginHandshakeInternal(OpenSSLEngineImpl.java:335)
W System.err: at com.android.org.conscrypt.OpenSSLEngineImpl.beginHandshake(OpenSSLEngineImpl.java:325)
Switching to the legacy HTTP handler didn't help as well.
We addressed a bunch of these issues in the 6 and 7 servicing releases around the Dec / Jan timeframe. @Lukas123798, I'd grab the latest and try again.
The error "Handshake has already been started" used to occur on Android API 21-26 and it was fixed in #78849. That fix was shipped in one of the recent servicing releases as @steveisok said.
Activity
janseris commentedon Aug 14, 2022
Might be the same issue as connecting to Sql Server where SSL fails (used on log in even when not encrypting)
Lukas123798 commentedon Aug 20, 2022
Is there some solution or conclusion ?
akravch commentedon Sep 15, 2022
Facing the same issue on a non-MAUI Android .NET 6 app with errors like this:
Also, in logcat I see the following right before the .NET exception:
Switching to the legacy HTTP handler didn't help as well.
wfurt commentedon Mar 8, 2023
do you see that with .NET 7 as well? AFAIK there were many improvements. cc @simonrozsival
steveisok commentedon Mar 8, 2023
We addressed a bunch of these issues in the 6 and 7 servicing releases around the Dec / Jan timeframe. @Lukas123798, I'd grab the latest and try again.
simonrozsival commentedon Mar 8, 2023
The error
"Handshake has already been started"used to occur on Android API 21-26 and it was fixed in #78849. That fix was shipped in one of the recent servicing releases as @steveisok said.