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
2
votes
4 answers

Sending files over TCP/ .NET SSLStream is slow/not working

Im writing an Server/Client Application which works with SSL(over SSLStream), which has to do many things(not only file receiving/sending). Currently, It works so: Theres only one connection. I always send the data from the client/server using…
Tearsdontfalls
  • 767
  • 2
  • 13
  • 32
2
votes
2 answers

Why does reading from an SslStream across AppDomains succeed but return an empty buffer?

When reading normally from an SslStream using the Read(byte[] buffer, int offset, int count) method, I get the expected results. However, if I move the SslStream object into a new AppDomain, the read still appears to function correctly (i.e. the…
g t
  • 7,287
  • 7
  • 50
  • 85
1
vote
1 answer

Does SslStream.Dispose dispose its inner stream

I use NetworkStream with sockets in an SslStream socket server as follows: stream = new NetworkStream(socket, true); sslStream = new SslStream(stream, false); My question is, if when I call sslStream.Dispose(), will the SslStream dispose/close its…
dabididabidi
  • 41
  • 1
  • 6
1
vote
1 answer

BeginAuthenticateAsClient doesn't work in new AppDomain

I am trying to create an SslStream object in a new AppDomain. However, running the BeginAuthenticateAsClient method on the stream causes an Exception to be thrown. internal class SslWrapper : MarshalByRefObject { public void CreateStream(Stream…
g t
  • 7,287
  • 7
  • 50
  • 85
1
vote
2 answers

How to Create a TCP Client connection with a Client Certificate in Powershell

With Following code i can establish a SSL Connection: $cert = dir cert:\CurrentUser\My | where {$_.Subject -like "*Alice*"} $computerName = "google.com" $port = "443" $socket = New-Object Net.Sockets.TcpClient($computerName, $port) …
icnivad
  • 2,231
  • 8
  • 29
  • 35
1
vote
1 answer

SSL over TCP Authenticate Windows Service with certificate

I have one server and three clients in which a windows service is running with local system privileges. Clients and server are mutual authenticated using SSL over TCP and certificates (I'm using the SSLStream class C++\CLI…
DropTheCode
  • 465
  • 1
  • 7
  • 14
1
vote
1 answer

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…
Robbie Hanson
  • 3,259
  • 1
  • 21
  • 16
1
vote
0 answers

SslStream .NET Class communicate with Java

I have a .NET SSL server that use SslStream class to communicate with clients. Does anyone know if this class can communicate with sockets of other languages like Java or only with .NET ? Thanks. ----- EDIT ---- It works.
DropTheCode
  • 465
  • 1
  • 7
  • 14
1
vote
3 answers

Transport Layer Security in the .NET framework

I've been asked a question by the boss and actually I can't find any sort of coherent / comprehensive answer out there! So I turn to you, the wise and all-knowing collective of StackOverflow :) The question of the day is "Does .NET support transport…
Clint
  • 6,133
  • 2
  • 27
  • 48
1
vote
1 answer

Connect Flutter to SslStrem in C#

I have this c# server using SslStream: TcpListener Server = new TcpListener(IPAddress.Any, 13001); Server.Start(); var client = Server.AcceptTcpClient(); var stream = client.GetStream(); SslStream sslStream = new SslStream(stream, false); var…
AdamA
  • 149
  • 1
  • 8
1
vote
1 answer

Cannot access a disposed object. Object name: 'SslStream'

We have an service bus triggered Azure function which makes a call to an http triggered Azure function and from times to times we are experiencing the error below, The operation was canceled. The read operation failed, see inner exception. Cannot…
1
vote
1 answer

GZipStream 4G limit - total or currently streaming?

Have aa GzipStream feeding an SSLStream. First time today noticed "The gzip stream can't contain more than 4GB data." at System.IO.Compression.FastEncoder.GetCompressedOutput(Byte[] outputBuffer) at…
Greg Domjan
  • 13,943
  • 6
  • 43
  • 59
1
vote
1 answer

Get "The server mode SSL must use a certificate with the associated private key." error in X509Certificate2 by use .cer instead of .pfx

I use .cer and .key files in custom web server for validate ssl with SslStream.AuthenticateAsServerAsync(). creating process of X509Certificate2 is some things like this: var bytes = File.ReadAllBytes(certificatePath); using var publicKey = new…
Ali Qamsari
  • 93
  • 1
  • 10
1
vote
1 answer

Interop Crypto OpenSslCryptographicException: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

No matter target to net5.0 or net6.0 framework, when trying to create a sslstream, it repeatedly throw the error running on Ubuntu OS while works on Windows OS, what's the proper way to handle this error ? Error Message …
nwpie
  • 665
  • 11
  • 24
1
vote
0 answers

C#: sslStream and local proxy

We have a server which accepts ssl connection. Say if I request for https://gmail.com then the server first checks if i have logged in to it, if yes then it connects to gmail and sends the response back. If I have not logged in then it redirects to…
irbash
  • 43
  • 1
  • 1
  • 9