Revert "[Mono.Security]: Improve error reporting when sending TLS Alerts fail."
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 15 Jan 2015 16:04:32 +0000 (11:04 -0500)
committerRodrigo Kumpera <kumpera@gmail.com>
Thu, 15 Jan 2015 16:04:32 +0000 (11:04 -0500)
This reverts commit 95eff2495093ccd20ad2db7df3f07a835d580e5e.

mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs

index a22f9b51c8638d92e463c7b247af95f88275ca06..166f12f0d23c7d0790fc722c2d140494f75b1b11 100644 (file)
@@ -699,13 +699,8 @@ namespace Mono.Security.Protocol.Tls
                                close = alert.IsCloseNotify;
                        }
 
-                       try {
                        // Write record
-                               this.SendRecord (ContentType.Alert, new byte[2] { (byte) level, (byte) description });
-                       } catch (Exception ex) {
-                               throw new IOException (string.Format (
-                                       "Exception while sending TLS Alert ({0}:{1})", level, description), ex);
-                       }
+                       this.SendRecord (ContentType.Alert, new byte[2] { (byte) level, (byte) description });
 
                        if (close) {
                                this.context.SentConnectionEnd = true;
index fe68ebf3e2e5ac8753031a6cc7c65dba2ca47f3a..d0d0721a12d106413f1fd9568245c9ebea49605a 100644 (file)
@@ -588,26 +588,14 @@ namespace Mono.Security.Protocol.Tls
                        }
                        catch (TlsException ex)
                        {
-                               AggregateException aggregate;
-                               try {
-                                       // FIXME: should the send alert also be done asynchronously here and below?
-                                       this.protocol.SendAlert(ex.Alert);
-                                       aggregate = new AggregateException ("The authentication or decryption has failed.", ex);
-                               } catch (Exception alertEx) {
-                                       aggregate = new AggregateException ("The authentication or decryption has failed (error while sending Alert).", ex, alertEx);
-                               }
-                               negotiate.SetComplete (aggregate);
+                               // FIXME: should the send alert also be done asynchronously here and below?
+                               this.protocol.SendAlert(ex.Alert);
+                               negotiate.SetComplete (new IOException("The authentication or decryption has failed.", ex));
                        }
                        catch (Exception ex)
                        {
-                               AggregateException aggregate;
-                               try {
-                                       this.protocol.SendAlert(AlertDescription.InternalError);
-                                       aggregate = new AggregateException ("The authentication or decryption has failed.", ex);
-                               } catch (Exception alertEx) {
-                                       aggregate = new AggregateException ("The authentication or decryption has failed (error while sending Alert).", ex, alertEx);
-                               }
-                               negotiate.SetComplete (aggregate);
+                               this.protocol.SendAlert(AlertDescription.InternalError);
+                               negotiate.SetComplete (new IOException("The authentication or decryption has failed.", ex));
                        }
                }