From ebf1665dbc31a2f10c0e00c43285146858615cbb Mon Sep 17 00:00:00 2001 From: Olov Karlsson Date: Tue, 2 Dec 2014 08:49:47 +0100 Subject: [PATCH] And now alternate names can be extracted from certificates on machines other then US/english --- .../SSL/SSLModuleService80.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs80/SSL/SSLModuleService80.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs80/SSL/SSLModuleService80.cs index 3e1a6382..1ba070aa 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs80/SSL/SSLModuleService80.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs80/SSL/SSLModuleService80.cs @@ -282,8 +282,8 @@ namespace WebsitePanel.Providers.Web.Iis if (!dedicatedIp) { hostNames.AddRange(certificate.Extensions.Cast() - .Where(e => e.Oid.FriendlyName == "Subject Alternative Name") - .Select(e => e.Format(true).Replace("DNS Name=", ""))); + .Where(e => e.Oid.Value == "2.5.29.17") // Subject Alternative Names + .SelectMany(e => e.Format(true).Split(new[] {"\r\n", "\n", "\n"}, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Split('=')[1]))); } var simpleName = certificate.GetNameInfo(X509NameType.SimpleName, false);