Search code examples
c#.netsslconsolesslstream

TCPClient With SSL and Client Certificate not required Server Connection with Client Fails


I had Implemented TCP Client With SSlstream and try to connect server. I had provided Client certificate. Now the Problem is that when i tried to run the client when server Certificate is required and ClientAuthentication Required in that case it works succesfully.

But when i tried to connect with server settings Client Authentication not required at that time i am not able to do the proper communication and it is giving me that connection to port is not successful because underlying connection is closed. so please suggest what is exact tcpclient sslstream implementation which will connect with SSL Enabled server and Client Authentication is not required. it seems like when there is clientAuthentication is not required at that time it gives it is still checking for authentication so it is giving me IsMutuallyAuthenticated Property of sslStream class false where is IsAuthenticatedProperty true.


Solution

  • The issue was with the server implementation , due to configuring it with the not required client certificate, it was internally taking that into consideration, once i tried with fresh implementation of server i was able to connect when there is no client authentication required implementation as well.