Questions tagged [sslstream]

.NET class that provides a stream used for client-server communication that uses TLS/SSL security protocols to authenticate the server and optionally the client.

Documentation: https://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx

231 questions
96
votes
10 answers

Authentication failed because remote party has closed the transport stream

I am developing a TCP client to connect OpenSSL server with the certificate authentication. I have using .crt and .key files shared by server team. These certificates are generated by OpenSSL commands. I am using SslStream object to authenticate the…
Odelu
  • 969
  • 1
  • 7
  • 7
29
votes
3 answers

.NET SslStream doesn't close TLS connection properly

.NET's SslStream class does not send the close_notify alert before closing the connection. How can I send the close_notify alert manually?
Artur
20
votes
6 answers

How do I identify my server name for server authentication by client in c#

I have recently been trying to make a SSL encrypted Server/Client in C#. I have followed this tutorial on MSDN, however, it required a certificate to be created for the server and client usage using makecert.exe so I found an example and it created…
David Kroukamp
  • 36,155
  • 13
  • 81
  • 138
19
votes
3 answers

Using SSL and SslStream for peer to peer authentication?

I need to provide secure communication between various processes that are using TCP/IP sockets for communication. I want both authentication and encryption. Rather than re-invent the wheel I would really like to use SSL and the SslStream class and…
Scott Whitlock
  • 13,739
  • 7
  • 65
  • 114
19
votes
2 answers

How to (repeatedly) read from .NET SslStream with a timeout?

I just need to read up to N bytes from a SslStream but if no byte has been received before a timeout, cancel, while leaving the stream in a valid state in order to try again later. (*) This can be done easily for non-SSL streams i.e. NetworkStream…
Pol
  • 3,848
  • 1
  • 38
  • 55
13
votes
1 answer

AuthenticateAsClient: System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream

Due to Heartbleed, our Gateway Server was updated and this problem presented itself. Due to POODLE, SSLv3 is no longer supported. Note, the problem is only present on Win7+ boxes; WinXP boxes work without issue (same code, different OS = problem);…
Bret
  • 2,283
  • 4
  • 20
  • 28
11
votes
1 answer

Cipher selection for sslStream in .NET 4.5

I am trying to create a TLS1.1/TLS1.2 server using .Net's sslStream class. It appears that by default the only cipher suites that this stream accepts are:…
elsevers
  • 532
  • 1
  • 4
  • 16
10
votes
1 answer

Mutual SSL Authentication - Local certificate in sslstream returning 'null' instead of certificate on client

I am working on creating an windows service which will make a call to a API. For this process, I am trying to establish a Mutual (Two way) SSL authentication. Since I am newbie to this. I tried to implement a simple client and server project…
Gopichandar
  • 2,742
  • 2
  • 24
  • 54
10
votes
4 answers

Certificate problem with a new machine - credentials supplied to package not recognized

I am installing a windows service on a new machine. The service does various operations over SslStream over TCP, which uses the certificate in problem. The service has been operating fine with the same code and same certificate on other 2 windows…
cdpnet
  • 580
  • 2
  • 7
  • 23
9
votes
1 answer

SslStream equivalent of TcpClient.Available?

Based on the advice of @Len-Holgate in this question, I'm asynchronously requesting 0-byte reads, and in the callback, accept bytes the available bytes with synchronous reads, since I know the data is available and won't block. This seems so…
Jason Kleban
  • 20,024
  • 18
  • 75
  • 125
9
votes
1 answer

How to validate self-signed certification

i will provide you with my question clearly so you can answer me I have a client-server (socket) connection that i secured using SslStream and as i know using ssl makes me sure that my client will only connect to my server And to do that i must add…
Daniel Eugen
  • 2,712
  • 8
  • 33
  • 56
8
votes
1 answer

What level of thread-safety can I expect from System.Net.Security.SslStream?

I have an application which uses SslStream to send and receive data with its own fixed-length framing. The stream is created by wrapping the NetworkStream returned from TcpClient.GetStream() like so: var client = new…
Hunter Morris
  • 417
  • 3
  • 8
7
votes
2 answers

Verify Remote Server X509Certificate using CA Certificate File

I've generated a CA and multiple certificates (signed by CA) using OpenSSL and I have a .NET/C# client and server both using SslStream which each have their own certificates/keys, mutual authentication is enabled and revocation is disabled. I'm…
user985122
  • 71
  • 1
  • 3
7
votes
3 answers

Unity TlsException: Handshake failed UNITYTLS_X509VERIFY_FLAG_NOT_TRUSTED

I'm trying to update my application's TcpClient to use TLS with SslStream instead of the normal Stream, the code i'm using for this seems to work outside of Unity, but fails when integrated in my Unity 2019.1.8 (tested on 2018 and 2017 as well)…
Remy
  • 4,843
  • 5
  • 30
  • 60
7
votes
1 answer

SslStream and Authentication

I was reading MSDN info articles for quite a long time and still I fail to understand it. Based on the assumption that client Authentication is not required: 1.When I call SslStream.AuthenticateAsServer(...) do I call this method on the server side…
WeinForce
  • 1,264
  • 2
  • 11
  • 17
1
2 3
15 16