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
0 answers

SslStream - AuthenticateAsClient Forced even with TcpClient NetworkStream with a port of 143 (http)

Im having a hard time trying to connect to: imap.suddenlink.net:143 (IMAP 4) Strangely, I can never seem to receive data back after sending a command by writing to the NetworkStream. Command seems to write fine, but when reading, I don't get…
Ma Dude
  • 477
  • 1
  • 5
  • 17
0
votes
0 answers

x509 Certificate for localhost in windows for using AuthenticateAsServer()

hi I want to Create X509Certificate To Use in SslStream.AuthenticateAsServer() on windows 10 loopbak. I try to Create Certificate with OpenSsl and Makecert Script but certificates not work. please help me. my Code : X509Store store = new…
ali mahdavi
  • 1
  • 1
  • 4
0
votes
1 answer

Secure WebSocket Server with C# and AWS Certificates

I'm trying to write a secure websocket (WSS) server in C#. I started out with unsecure sockets using TcpClient objects, but assumed I need to use SslStream for the secure version. I know I need to use AuthenticateAsServer() to add a certificate and…
Roxerg
  • 116
  • 1
  • 13
0
votes
1 answer

SslStream AuthenticateAsClient using PFX file

I'm trying to connect to a server using an SslStream. I've been given a PFX file from the owner of the server and I've installed it on my client but I'm not sure how to access the certificate from my code. Specifically, imagine that I have the…
Jeremy Jarrell
  • 661
  • 1
  • 11
  • 20
0
votes
0 answers

c# sslstream sending data in chunks

I am trying to send data via sslstream from my c# webserver to a Browser. For some reason "Transfer-Encoding: chunked" is not working. Do you see any mistakes in my code below: string header = HTTPServer.VERSION + " " + status + "\r\nContent-Type:…
0
votes
0 answers

ValidateServerCertificate never called

I'm trying to connect to an https server using the SslStream class (the server uses a trusted root certificate), right after the sslStream.AuthenticateAsClient the CertificateSelectionCallback has been called but it never calls the…
0
votes
1 answer

How does c# SslStream's read() function know when to return 0?

I have an ssl client set up in c# and am currently taking steps to make sure socket reads are as reliable as they can be. The SslStream.read() documentation indicates that it returns 0 when there is no more data to read, what does that mean exactly?…
user740521
  • 1,175
  • 4
  • 12
  • 25
0
votes
0 answers

Authentication failed as remote party has closed the transport stream

I am trying to connect to an Exchange server using IMAP from my .NET 4.0 application. Below is the code I have problem with: var host = "mail.mydomain.com"; var port = 993; var tcpClient = new TcpClient(host, port); var stream = new…
Kamyar
  • 18,639
  • 9
  • 97
  • 171
0
votes
0 answers

Does Microsoft SChannel 7 support OpenSSLs non-standard HandshakeTypes?

Looking at the OpenSSL source code (ssl3.h) I note that it supports some non-standard HandshakeTypes: 24, 67 and 254. Does SSLStream/SChannel support these? Does SChannel have any non-standard extensions of its own? I'm primarily interested in the…
Jan Mattsson
  • 154
  • 2
  • 9
0
votes
0 answers

Able to write in sslstream but unable to read

I am trying to write/read to sslstream on 443 port. I can able write data to that sslstream but while reading from that sslstream,​ it is waiting to read, forever. Sample code: var add= "IPGoesHere"; var port = 443; var remoteIpAdd=…
NANDAKUMAR THANGAVELU
  • 611
  • 3
  • 15
  • 34
0
votes
1 answer

Reading/Writing TcpClient/SslStream in separate threads

I have an SSL connection to a server and post requests to it. The act of posting a message should be instant with no delay to read the response, because there would be consequent posts that should come without the delay. That's why i just do …
Pingguoren
  • 31
  • 4
0
votes
1 answer

C# How to get SslStream to ignore client cert validation

We have a client that has their own PKI infrastructure and assigns private certs to use as SSL client authentication for application access to their rest APIs. I need to be able to use a client cert with SslStream and not have it choke that it is…
John C
  • 1,761
  • 2
  • 20
  • 30
0
votes
0 answers

SslStream and PFX certificate failed

I can connect with server successfully using python client like this: ... sslSock = ssl.wrap_socket(sock, key_file, cert_file, ssl_version=ssl.PROTOCOL_TLSv1) ... But I cannot connect with server using C# : ... byte[] pfxData =…
0
votes
0 answers

How can I add SSL encryption to available TCP/IP socket

I am going to upgrade a system which used TCP connection without SSL. I want to add SSL encryption to the current connection without changing much in code. This is what there was previously in the code. IPAddress ipAddress =…
Lasitha Yapa
  • 4,309
  • 8
  • 38
  • 57
0
votes
2 answers

Can't get number of available bytes for SslStream

I'm trying to determine the number of bytes available to be read so I can read from the SslStream until all data has been read. SslStream doesn't appear to have a property or method to do this so I've been trying to use the underlying Socket. The…
CSCoder
  • 154
  • 1
  • 15