Secure Web Socket client and FQDN #487
-
Hello. During connection The second problem is specific to Xamarin.Android. "System.Net.WebSockets.ClientWebSocket" class ignores Network Security Configuration and does not trust self-signed certificates. Third problem is that according to RFC rfc7118 a subprotocol "sip" hast to be used during websocket handshake and a library does not give any possibility to control this. Thank you in adavance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, a better approach would be to use the SIPClientWebSocketChannel.SendSecureAsync method that takes the common name of the web socket server certificate. The problem is that method doesn't currently pass the server certificate name through. I've created #488 to fix it. I'll ping you from that issue when it's ready to test.
I don't know enough about Android/Xamarin to suggest a .NET fix. As an alternative you could use LetsEncrypt to generate a free valid certificate for your testing. In my experience it's now often quicker to get a valid free certificate than to wrestle with self signed certificates.
I did add the sip subprotocol constant but didn't wire it up for some reason that I can't recall. Possibly because, as you've stated, the .NET web socket client doesn't allow it. If that's the case the only fix may be to find an alternative client web socket implementation. I won't be able to do that at the moment but Pull Requests are always welcome. |
Beta Was this translation helpful? Give feedback.
Yes, a better approach would be to use the SIPClientWebSocketChannel.SendSecureAsync method that takes the common name of the web socket server certificate. The problem is that method doesn't currently pass the server certificate name through. I've created #488 to fix it. I'll ping you from that issue when it's ready to test.
I don't know enough about Android/Xamari…