WebSocket connection with SSL Error

HI,

I am trying to establish a web socket connection(URL is SSL enabled) using "system.net.websockets.clientwebsocket" and tried other libraries like "webSocketSharp", "ebsocket4net" etc.. but not able to establish connection. It's throwing "Unable to connect to the remote server" with following inner exception details;

{System.Net.WebSockets.WebSocketException (0x80004005): Unable to connect to the remote server ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
at /Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/external/boringssl/ssl/handshake_client.c:1132
at Mono.Btls.MonoBtlsContext.ProcessHandshake () [0x00038] in <3e9b3e26c4694baab3f689687ad40612>:0
at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status) [0x0003e] in <3e9b3e26c4694baab3f689687ad40612>:0
at (wrapper remoting-invoke-with-check) Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake(Mono.Net.Security.AsyncOperationStatus)
at Mono.Net.Security.AsyncHandshakeRequest.Run (Mono.Net.Security.AsyncOperationStatus status) [0x00006] in <3e9b3e26c4694baab3f689687ad40612>:0
at Mono.Net.Security.AsyncProtocolRequest+d__24.MoveNext () [0x000ff] in <3e9b3e26c4694baab3f689687ad40612>:0
--- End of stack trace from previous location where exception was thrown ---
at Mono.Net.Security.AsyncProtocolRequest+d__23.MoveNext () [0x0008b] in <3e9b3e26c4694baab3f689687ad40612>:0
--- End of inner exception stack trace ---
at Mono.Net.Security.MobileAuthenticatedStream+d__47.MoveNext () [0x00254] in <3e9b3e26c4694baab3f689687ad40612>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Net.WebSockets.WebSocketHandle+d__24.MoveNext () [0x00199] in <3e9b3e26c4694baab3f689687ad40612>:0
at System.Net.WebSockets.WebSocketHandle+d__24.MoveNext () [0x00391] in <3e9b3e26c4694baab3f689687ad40612>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Net.WebSockets.ClientWebSocket+d__16.MoveNext () [0x000d1] in <3e9b3e26c4694baab3f689687ad40612>:0
--- End of stack trace from previous location where exception was thrown ---
at TextflowLive_Android.WebSocketWrapper+d__16.MoveNext () [0x0004f] in /Users/devuser/Projects/TextflowLive_Android/TextflowLive_Android/ASRAPI/WebSocketWrapper.cs:65 }

HttpClient Implementation : AndroidClientHandler
SSL/TLS Implementation : Native TLS 1.2+

And tried solution what all provided in forums like below;

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(OnValidationCallback);
public static bool OnValidationCallback(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors errors)
{
return true;
}

"But still same error"

Please help me to proceed.

Posts

Sign In or Register to comment.