Sending a Public Key
Closed this issue · 8 comments
If I want to send the certificate exported: how would I do that? For example: My server accepts the connection only If I pass in a unique key. How can I send it via PCL lite?
Not sure. I need to look into that. It is not a feature of the current version of the library.
Thanks!
Can you point to what part the Websocket specification your are specifically thinking about?
After looking into this I think that passing your certificate is not related to the Websocket protocol but your server. What does your server documentation say?
For instance, you could pass your certificate as part of the query string, something like:
wss://www.servername.com:443/cert/?certificate=<xyz...123>
(Note: This is just an example and probably not what you server expects at all)
Or, maybe you server is requiring a Client Certificate for the SSL/TLS connection?
In which case this is really related to the Socket layer (not the Websocket layer) and since Client Certificate is not supported in the SocketLite.PCL this is currently not possible with this library. There is a reason it is called "lite" after all ;-)
Hi, I tried the above recommended solution(wss://www.servername.com:443/cert/?certificate=<xyz...123>) and I am getting this error:
{System.Net.Sockets.SocketException (0x80004005): The socket has been shut down\n at System.Net.Sockets.Socket.EndSend (System.IAsyncResult result) [0x0002d] in /Users/builder/data/lanes/3511/f4db8a57/source/mono/mcs/class/System/System.Net.Sockets/Socket.cs:2663 \n at System.Net.Sockets.NetworkStream.EndWrite (System.IAsyncResult asyncResult) [0x0005f] in /Users/builder/data/lanes/3511/f4db8a57/source/mono/mcs/class/referencesource/System/net/System/Net/Sockets/NetworkStream.cs:1043 }
My apologies for not being more clear. The example above was just that "an example". Since I don't know your Websocket server I have no idea what it expects. Can you share what kind of server it is, I might be able to read about how it works?
Also, the more I think about it, the more I think that a Client-Side certificate is probably related to the SSL/TLS layer, and as mentioned this library does not currently support Client-Side certificates and I have no plan implementing it at the time.
My apologies for not replying to your question. I am sorry I cannot share server since it is for local use only. I am positive it is SSL/TLS layer issue. Please keep me posted if you hear anything about the fix!
Thanks!