sslstream

.NET SslStream doesn't close TSL connection properly.

It doesn't send close_notify alert before closing the connection. How can I send close_notify alert? ...

SslStream on TCP Server fails to validate client certificate with RemoteCertificateNotAvailable

This question is all about solving a SslPolicyError.RemoteCertificateNotAvailable error. I have developed a TCP Server with SSLStream and a TCP Client for the other end. I authenticate the server with: sslStream.BeginAuthenticateAsServer I authenticate the client with: sslStream.BeginAuthenticateAsClient I am loading my client c...

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 self-signed certificates. What I want to do is validate the remote process's certificate...

Does SslStream use LocalCertificateSelectionCallback when acting as a server?

If I create a SslStream instance like this: secureStream = new SslStream(stream, true, tlsRemoteCallback, tlsLocalCallback); And then I use one of the AuthenticateAsServer or BeginAuthenticateAsServer methods, is it at all possible for the LocalCertificateSelectionCallback (tlsLocalCallback) to be invoked? And if so, how? I'm under ...

Using SslStream with IOCP

I have written a TCP server using the Socket class's asynchronous/IOCP methods, BeginSend()/BeginRead()/etc. I would like to add SSL capability using SslStream, but from the interface it looks like Socket and SslStream are not intended to work together, in particular because I'm not using Streams at all and SslStream appears to depend o...

Socket.ReceiveAsync and SslStream

Hi, It seems that I cannot get the benefit of ReceiveAsync when using SslStream since I will have to do the reading through SslStream, which only supports the Begin* End* async model. Is it possible to just use SslStream until authentication is done, and from then on just access the socket directly? This means I would have to find out...

Using intermediate certificates with SslStream and X509Certificate2 in a server app

I am working on a .Net server application that uses SslStream to provide its SSL sockets. It works with some clients (such as those based on libcurl), but other clients throw errors due to the lack of the intermediate certificate(s). How can I associate the intermediate certificate with the SslStream or X509Certificate2 object to make ...

SSL certificate setup for SslStream

I have a situation where I need to generate SSL certificates for clients using SslStream as a server. I know how to do that (makecert.exe), but I run into a problem when trying to ensure that both sides of the connection are authenticated. Basically, if I use self signed cert, I need to add it to the trusted roots to get mutual authent...

SslStream.AuthenticateAsClient Exception when using iPhone Apple Push Notification Provider (apns-sharp) C#

I receive the following exception when using the Apple Push Notification Provider (apns-sharp). The push notifications work on my development machine however it will not work within the Rackspace Cloud hosting. I have the exact Rackspace Cloud custom medium trust configuration running with my dev. machine so the medium trust can't be ...

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 2003 machines. But, this new machine is Windows 2003 with 64 bit processor too. I am runni...

Raw FTP SSL with C#

Hi, I'm trying to understand how SSL works. In my wish to make a small FTP client which supports SSL I've run into some problems: TcpClient FtpConnection = new TcpClient(FtpServer, FtpPort); NetworkStream FtpStream = FtpConnection.GetStream(); StreamReader FtpReader = new StreamReader(FtpStream); FtpWriter = new StreamWriter(IrcStream)...

BeginAuthenticateAsClient hangs when called from a client to a non-secure server

I am developing an application that implements a TCP client. It needs to be able to talk to a server with or without TLS, either via a NetworkStream or an SslStream. When I connect I don't know which settings the server uses. My code works fine from non-secure to non-secure and from secure to secure. However when I set my client to use ...

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

Hello 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 RemoteCertificateValidation callback on the sslStream class. The certificate is given as a X509C...

.NET UDP & DTLS

Is there a native way to provide DTLS support for UDP sockets in .NET? edit by native I mean those that are in .NET framework out-of-the-box. ...

SslStream Delays after inactivity

Hi SO, I have written a client app to talk to a third party server app. Its comms is over a custom port with SSL usng the SslStream class. The server allows permanent connections however I've found I have to ping the server with a command within 60 seconds to maintain a reasonable level of responsiviness. After 60 seconds the comms sti...

Client/Server Authentication with SSLStream

Hello, I have a client and server application which use SSLStream to communicate over port 80. Both the client and the server are running as Windows Services. Everything works in my test environment (my development computer, under the OS Windows 7 Ultimate). My problem is that when I go to deploy the client and server application to ...

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, CompressionMode.Decompress); stream.Read(...); If this is possible, is the SslStream still in a useable state afte...