From 5e08742b5c299c0503d11ea44d115c32a6b7c68f Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 26 Apr 2017 18:30:17 -0400 Subject: [PATCH] [System]: Fix bug #52508 in HttpListener when doing multiple Https request. Move the call to SslStream.AuthenticateAsServer() into the constructor because we don't want to call it again when Init() is called from Close(). --- mcs/class/System/System.Net/HttpConnection.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mcs/class/System/System.Net/HttpConnection.cs b/mcs/class/System/System.Net/HttpConnection.cs index 680ec8188ed..bd465b9ca29 100644 --- a/mcs/class/System/System.Net/HttpConnection.cs +++ b/mcs/class/System/System.Net/HttpConnection.cs @@ -97,6 +97,8 @@ namespace System.Net { stream = ssl_stream; } timer = new Timer (OnTimeout, null, Timeout.Infinite, Timeout.Infinite); + if (ssl_stream != null) + ssl_stream.AuthenticateAsServer (cert, true, (SslProtocols)ServicePointManager.SecurityProtocol, false); Init (); } @@ -114,10 +116,6 @@ namespace System.Net { void Init () { - if (ssl_stream != null) { - ssl_stream.AuthenticateAsServer (cert, true, (SslProtocols)ServicePointManager.SecurityProtocol, false); - } - context_bound = false; i_stream = null; o_stream = null; -- 2.25.1