Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Currently I have implemented one secure server using TCPListener and trying to connect to it from client which is, Javascript application through browser. I am trying to communicate using SSLStream and proper certificate is provided using following method.

private static X509Certificate2 GetServerCert()
{
     X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine); 
     store.Open(OpenFlags.ReadOnly);
     X509Certificate2Collection cert = 
              store.Certificates.Find(X509FindType.FindByThumbprint, "XXXXXX-
              THUMBPRINT_OF_CERTIFICATE_HERE- XXXXXXX", true);
     return cert[0];
}

Now when I connect with this server using "wss://ipaddress:port", handshake and data communication works well if client is running from Chrome browser but when I connect same from Internet explorer, client gets connected with server but no data is received using SSLStream i.e. zero bytes from SSLStream and again automatically gets disconnected from server. Please let me know are there any browser specific settings for connecting with TCPListener for wss requests.

Internet Explorer Version : 11.0.9600.18738 (Not working)
Chrome Version : 61.0.3163.100 (Official Build) (64-bit) (Working)
Certificate being used is added to Trusted Certificate Store.

Even if it works from Chrome there is one more question, it always get two requests for one click from client. In the first hit, it gets blank header and then automatically in the second hit it gets full header.

What I have tried:

Non secure requests from same client application are working properly with TCPListener Server from both the browsers(Internet Explorer and Chrome).
"ws://ipaddress:port"
Posted
Updated 3-Oct-17 3:56am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900