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

sslstream won't work with SMTP protocol

The code i am using is simply for testing, here i test with gmail: C# code: private void button1_Click(object sender, EventArgs e) { string server = "smtp.gmail.com"; int port = 25; client = new TcpClient(); …
1
vote
2 answers

Avoiding administrator access for SslStream.AuthenticateAsClient?

I have an application which uses the .NET SslStream class along with client and server certificates. This application works great on Windows XP. However on Windows 7 (probably Vista too), the below exception appears when calling…
zdv
  • 423
  • 3
  • 13
1
vote
0 answers

SslStream.AuthenticateAsClientAsync does not populate sender value when calling RemoteCertificateValidationCallback on Xamarin.Android

In CertificateValidationCallBack, sender is null when I run this code on Android while the same value is set on Windows. The code below uses sync methods but I also tested async and they behave the same. Is it a bug of Xamarin.Android or am I…
Alex
  • 2,469
  • 3
  • 28
  • 61
1
vote
1 answer

Is there any possibility to use TLS12 SslStream in Xamarin for Android?

I know that Mono doesn't support TLS1.1 and TLS1.2 in current version of Xamarin so maybe there is possibility to implement TLS12 on my way? This part of code doesn't work for Xamarin.Android: _clientSocket = new TcpClient(); await…
XueBao
  • 13
  • 1
  • 4
1
vote
1 answer

SslStream AuthenticateAsServer The credentials supplied to the package were not recognized

Using c# to communicate via SSL with SslStream. I am using certificates generated myself and imported into Windows certificate store w/ certlm.msc. I am getting the following exception "The credentials supplied to the package were not recognized"…
dan
  • 801
  • 15
  • 41
1
vote
1 answer

Client/Server Authentication with SSLStream

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…
echoKientics
  • 11
  • 1
  • 2
1
vote
2 answers

SslStream Delays after inactivity

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…
Dave Hogan
  • 3,201
  • 6
  • 29
  • 54
1
vote
0 answers

Raw Socket Connection with SSL C#

Need to implement SSL with Socket connection class in c# to get the web page. I searched on google but not found any proper code snippets I am able to get data without ssl string request = "GET…
1
vote
1 answer

.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.
Primary Key
  • 1,237
  • 9
  • 14
1
vote
1 answer

How to get length of bytes received from sslsteam using ReadAsync method when you don't know the length?

I am using the below Async method to get response from the server. The response I get from the server varies from 1200 to 1500 bytes based on the request type. So, I can't fix the size of the buffer. Is there any way from SslStream.ReadAsync to get…
VinothNair
  • 614
  • 1
  • 7
  • 24
1
vote
2 answers

sending big file with socket to server c#

I'm trying to send a file about 250 kb to server but i have a corruption and it seemd that tottaly transfered some bytes only. The flow of command is Write to stream: Send\r\n Write to stream: FileName\r\n Write to stream: FileData \r\n Close the…
user1654278
  • 67
  • 1
  • 10
1
vote
1 answer

How to implement a Https web server using SslStream and a self signed certificate?

The problem was that SslStream always read 0 bytes because the chrome web browser cannot validate the server's certificate. Refer to the msdn sample code: https://msdn.microsoft.com/en-us/library/system.net.security.sslstream(v=vs.110).aspx I…
mind1n
  • 1,196
  • 3
  • 15
  • 34
1
vote
1 answer

Authenticating a SSL server against a pre-obtained copy of its self-signed certificate

I'm trying to communicate between a C# client and server with an SslStream. However my server's certificate is self-signed. The client owns a copy of the public part of the server's certificate, assumed to be transmitted over a tamper-proof (but not…
Medinoc
  • 6,577
  • 20
  • 42
1
vote
1 answer

How to create SSLStream which uses Ssl3 instead of Tls

I'm trying to establish tcp connection which is encrypted using Ssl3. Basically I'm just creating TCP connection and than I'm creating SSLStream on top of that: var ss = new SslStream(poolItem.SecureConnection, false,…
Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224
1
vote
1 answer

.NET 4.5 SslStream - Cancel a asynchronous read/write call?

Is there any way to cancel a asynchronous read or write task on a SslStream? I have tried providing ReadAsync with a CancellationToken but it doesnt appear to work. When the following code reaches it's timeout (the Task.Delay), it calls cancel on…
Matt
  • 774
  • 1
  • 10
  • 28