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
0
votes
1 answer

SslStream.AuthenticateAsClient or SslStream.AuthenticateAsServer error:Received an unexpected EOF or 0 bytes from the transport stream

The releated code while(true) { List accept=new List{ClientListener.Server,RequestListener.Server}; Socket.Select(accept,null,null,-1); foreach(var i in accept) …
0
votes
1 answer

In C# what is the point of using SslStream.AuthenticateAsServer() on the server side?

I am trying to listen for a secured TCP connection on a port. I was going through the server code example on microsoft docs. I am pasting here for quick reference: static void ProcessClient (TcpClient client) { // A client has connected.…
0
votes
1 answer

Handshake failed due to an unexpected packet format logging into a SMTP service

I am trying to connect to a SendGrid SMTP service over a secured connection. However, when I try to authenticate the TLS handshake, I get an System.IO.IOException saying "The handshake failed due to an unexpected packet format." I have confirmed…
Bill Heitstuman
  • 979
  • 1
  • 8
  • 23
0
votes
0 answers

C# SslStream fails to authenticate when client cant validate the certificate

I am writing a very basic http/https server and have all the ground work laid out. it works just fine under normal circumstances. but if a users tries to connect using a different domain or ip that isn't on the certificate the sslstream throws an…
0
votes
0 answers

Custom server certificate with Kestrel ConnectionHandler and SslStream

I'm getting this error when I call AuthenticateAsClientAsync on the client's SslStream: The handshake failed due to an unexpected packet format. All of this worked successfully using sockets, so the certificates and thumbprints are set up correctly,…
Steve Andrews
  • 561
  • 3
  • 14
0
votes
0 answers

Powershell scripts to get the FIPS algorithm status

I am looking for the powershell scripts/commands to get the details of below points | Key | OutPut | | ------------------------------ | ---------------- | | Seurity [FIPS Alogithm Policy] | Enabled/Disabled | |…
Prashant Kankhara
  • 1,498
  • 4
  • 15
  • 30
0
votes
0 answers

Secure Websocket over SSL connection authentication issue C#

I am working on a secure WebSocket implementation using the X509Certificate2 class and sslStream. While AuthenticateAsServer is called it gives the error of This operation is not allowed on a security context that has already been authenticated and…
0
votes
1 answer

c# SslStream.Read Loop problem

I've been learning C# by creating an app and i've hit a snag i'm really struggling with. Basicly i have the code below which is what im using to read from a network stream I have setup. It works but as its only reading 1 packet for each time the…
james
  • 1,031
  • 1
  • 15
  • 31
0
votes
1 answer

Verifying the chain of a self-signed certificate when using SslStream

I have a chain.pem -----BEGIN CERTIFICATE----- // My server cert signed by intemediate CA -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- // My intermediate cert signed by root CA -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- // My…
Matt
  • 25,943
  • 66
  • 198
  • 303
0
votes
1 answer

Xamarin iOS SslStream.AuthenticateAsUser() returns exception "Unknown Secure Transport error `PeerHandshakeFail'."

I'm working on a Xamarin application where i'm establishing a connection with a Server. The server code is currently a blackbox for me, i only have the documentation. However, since the server switched to TLS1.2 i'm trying use .NET's SslStream to…
Elias Johannes
  • 694
  • 2
  • 7
  • 26
0
votes
1 answer

Why would SslStream.AuthenticateAsServer fail from Ubuntu but not from Windows 10

The SslStream.AuthenticateAsServer method fails from Ubuntu but not from Windows 10. When implementing the SslStrem example from https://learn.microsoft.com/en-us/dotnet/api/system.net.security.sslstream?view=netframework-4.8 It runs fine when…
Willie Visagie
  • 171
  • 1
  • 14
0
votes
1 answer

Content-Length can't be trusted when reading a response from SslStream?

Playing with TcpClient and NetworkStream on .NET Core 2.2. Trying to get the content from https://www.google.com/ Before I continue, I'd like to make clear that I do NOT want to use WebClient, HttpWebRequest or HttpClient classes. There are a lot of…
Dejan Janjušević
  • 3,181
  • 4
  • 41
  • 67
0
votes
1 answer

TLS - TCP Client Authenticates on SslStream.AuthenticateAsClient(servername) but the server is not connecting to any Client, all on local machine C#

i am fairly new to Network Programming and i need help with connecting a TCP Client via TLS. I was given a project that was coded already and it came with both the certificate and the public key provided. I have installed the pfx certificate on my…
0
votes
2 answers

Enable Windows 2008 R2 to accept cast on enum SslProtocols 3072

Enable cast (System.Security.Authentication.SslProtocols)3072) on window server 2008 r2 without patch I have a function written in c# framework 2.0 that performs authentication by setting the tls 1.2 protocol using an enum, on windows 10 and windows…
Angelo
  • 101
  • 1
  • 9
0
votes
0 answers

How can I use C# and the SslStream class to open a connection with TLS channel binding?

I am attempting to implement SCRAM-SHA-1-PLUS in my XMPP library and I am stuck at the point of getting channel binding to work. I have a ChannelBinding object from the TransportContext of my SslStream but the value is not what the server is…
Coder2000
  • 281
  • 3
  • 12