[Mono-bugs] [Bug 75687][Nor] Changed - SslClientStream.BeginRead() blocks

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 2 11:11:25 EDT 2005

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien at ximian.com.


--- shadow/75687	2005-08-02 09:56:23.000000000 -0400
+++ shadow/75687.tmp.17225	2005-08-02 11:11:25.000000000 -0400
@@ -1,23 +1,23 @@
 Bug#: 75687
 Product: Mono: Class Libraries
 Version: 1.1
+OS: unknown
 OS Details: ubuntu breezy
 Status: NEW   
+Severity: Unknown
 Priority: Normal
 Component: Mono.Security
-AssignedTo: mono-bugs at ximian.com                            
+AssignedTo: sebastien at ximian.com                            
 ReportedBy: dominz at wp.pl               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
-Summary: SslClientStream.StartRead() blocks
+Summary: SslClientStream.BeginRead() blocks
 I tried to use asynchronously SslClientStream. It works properly, except
 that BeginRead() method blocks just like Read(). It makes no difference if
 it's first or fifth read operation afte swiching to TLS.
   Below is sample program that connects to Jabber server, performs TLS
@@ -136,6 +136,29 @@
 ------- Additional Comments From dominz at wp.pl  2005-08-02 09:56 -------
 Created an attachment (id=15526)
 test program
+------- Additional Comments From sebastien at ximian.com  2005-08-02 11:11 -------
+Sorry I can't try your code today (from this computer) but, from a
+quick look, this ...
+// TLS negotiation
+... _isn't_ the SSL/TLS negotiation. This is your protocol negotiation
+to start a TLS session. So the first time you call the sslStream
+instance ...
+sslStream.BeginRead(buf, 0, bufSize,
+	new AsyncCallback(DataReceived), null );
+... the SSL/TLS negotiation will occur - and because it is done from a
+BeginRead operation (and not a write) it is possible that it will lock
+(for the reason I explained in my email).
+Please try to do a...
+sslStream.Write (new byte [0], 0, 0);
+before the BeginRead as this should perform the negotiation from a
+safe point.

More information about the mono-bugs mailing list