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

c# SslStream.EndRead return zero bytes

My server program, deploy on many product environment run well, buy on one of machine which doesn't run as we expect. On this machine , when we call SslStream.BeginRead, then when SslStream.EndRead Called with 0 return, if we don't close the…
Robert Hu
  • 1
  • 1
0
votes
2 answers

C# SslStream with GZipStream

Is it possible to use GZipStream passing an SslStream in C#? i.e. can you do GZipStream stream = new GZipStream(sslStream, CompressionMode.Compress); stream.Write(...); ... GZipStream stream = new GZipStream(sslStream,…
Chris Cooper
  • 869
  • 2
  • 18
  • 42
0
votes
1 answer

Use tcpListener and sslstream to serve https request

Is it possible to serve https request using TcpListender and sslStream in .net?
Tony Zhu
  • 181
  • 1
  • 6
0
votes
1 answer

c# Tcp client transfer file with sslStream

I try to send a file with an sslStream of tcp client. File is about 250kb. When i don't write dataLength to stream, server closes the connection i thing because of max receive buffer size. When i write into stream the dataLength, i have no exception…
user1654278
  • 67
  • 1
  • 10
0
votes
2 answers

Send data from Tcp.Client.Socket with ssl Stream in .net c#

Im try to read an xml file and send to server with sslStream. Before send to server i must make Login and after succesfull authorization i must send the fileData. To fileSize is about 300kb. I can make sycessfull the login, but the problem is that…
user1654278
  • 67
  • 1
  • 10
0
votes
0 answers

Cannot connect to SSL TCP socket using TLS in node.js

I'm making a api service which connects to a SSL TCP server to retrieve data. I first made this api in C# and it works. Later I ported it to node.js to take the advantages of node.js. However I couldn't connect to the server. Target : Host :…
user4399732
0
votes
1 answer

What should I return from the LocalCerticateSelection callback in sslstream authenticateAsClient?

I have a certificate which I generated as self-signed and then had signed by a vendor. I have to connect to this vendor and authenticate using a certificate. When I do an AuthenticateAsClient, my LocalCertificateSelection callback gets called with…
0
votes
1 answer

How do I enforce host based security with SslStream?

Suppose I want to do host-based-security similar to HTTPS. What is the canonical validation code to verify that the server certificate matches the hostname and the certificate chain is valid when I open my SslStream connection?
Tim Lovell-Smith
  • 15,310
  • 14
  • 76
  • 93
0
votes
1 answer

OutputStream issue in sslsocket on android lollipop

I've got an android SSL client communicating with a c# ssl server. I have noticed a strange behaviour on the sslsocket on android lollipop. When I send some data to the server eg. "Hello Server" the server reads only the first character out of the…
Mr.Noob
  • 1,005
  • 3
  • 24
  • 58
0
votes
1 answer

Reset TCP connection if server closes/crashes mid connection

I have a tcp connection like follows: public void ConnectToServer() { string mac = GetUID(); while(true) { try { tcpClient = new TcpClient("xx.x.xx.xxx", xxxx); networkstream =…
Bnaffy
  • 129
  • 3
  • 14
0
votes
1 answer

How to get the Signature of a Self-Signed Certificate using X509Certificate or other .NET Class?

I am trying to verify a root/self-signed certificate by trying to decrypt the signature with a known/trusted Public Key, then checking if the decrypted hash matches the original certificate hash. I get the remote certificate by using…
aattia
  • 613
  • 4
  • 17
0
votes
1 answer

SSLStream and general use of delegates

I've never used delegates before but understand the basic concept after I've been struggling for the past 2 hours. I've created a simple SSL Client/Server with mutual authentication. Now my actual problem: In the example a delegate is used to…
voskart
  • 767
  • 1
  • 7
  • 15
0
votes
1 answer

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…
Ashok Rathod
  • 840
  • 9
  • 24
0
votes
1 answer

C# SslStream throws IOException on second request

Again me, yes. 5 minute of coding = 1 day trying to fix the code. Here is my code, which throws IOException (Unable to read from stream) only on the second request, the first works fine. The exception is thrown at bytes = sslStream.Read(buffer, 0,…
0
votes
1 answer

Is SSLSocket communication secure using the attached code?

I developed a Chat Server and client using Sockets and everything has been fine until I read somewhere online that ordinary Socket communication is vulnerable to attacks. After googling a while, I came across this page that showed a sample…