diff options
Diffstat (limited to 'mcs/class/System/Mono.Net.Security/MonoTlsStream.cs')
-rw-r--r-- | mcs/class/System/Mono.Net.Security/MonoTlsStream.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs b/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs index 79e4fbf6845..2a412482527 100644 --- a/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs +++ b/mcs/class/System/Mono.Net.Security/MonoTlsStream.cs @@ -96,8 +96,15 @@ namespace Mono.Net.Security sslStream = provider.CreateSslStream (networkStream, false, settings); try { + var host = request.Host; + if (!string.IsNullOrEmpty (host)) { + var pos = host.IndexOf (':'); + if (pos > 0) + host = host.Substring (0, pos); + } + sslStream.AuthenticateAsClient ( - request.Host, request.ClientCertificates, + host, request.ClientCertificates, (SslProtocols)ServicePointManager.SecurityProtocol, ServicePointManager.CheckCertificateRevocationList); |