diff --git a/Solutions/Main/IIS7/GlobalSuppressions.cs b/Solutions/Main/IIS7/GlobalSuppressions.cs index 1f14b1f0..60d55056 100644 --- a/Solutions/Main/IIS7/GlobalSuppressions.cs +++ b/Solutions/Main/IIS7/GlobalSuppressions.cs @@ -108,3 +108,9 @@ [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "LogDirectory", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7Website.#ModifyLogDirectory()")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "RapidFailProtection", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7AppPool.#SetCommonInfo()")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "LoadUserProfile", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7AppPool.#SetCommonInfo()")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "BasicAuthentication", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7Website.#ProcessApplications()")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "WindowsAuthentication", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7Website.#ProcessApplications()")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "AnonymousAuthentication", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7Website.#ProcessApplications()")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "DigestAuthentication", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7Website.#ProcessApplications()")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "SslFlags", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7Website.#ProcessApplications()")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Flags", Scope = "member", Target = "MSBuild.ExtensionPack.Web.Iis7Website.#SslFlags")] diff --git a/Solutions/Main/IIS7/IIS7Website.cs b/Solutions/Main/IIS7/IIS7Website.cs index ccf918f2..438fb730 100644 --- a/Solutions/Main/IIS7/IIS7Website.cs +++ b/Solutions/Main/IIS7/IIS7Website.cs @@ -14,7 +14,7 @@ namespace MSBuild.ExtensionPack.Web /// /// Valid TaskActions are: - /// AddApplication (Required: Name, Applications Optional: Force) + /// AddApplication (Required: Name, Applications Optional: AppPool, EnabledProtocols, AnonymousAuthentication, BasicAuthentication, DigestAuthentication, WindowsAuthentication, sslFlagsForce) /// AddMimeType (Required: Name, MimeTypes) /// AddResponseHeaders (Required: Name, HttpResponseHeaders) /// AddVirtualDirectory (Required: Name, VirtualDirectories Optional: Force) @@ -187,7 +187,12 @@ public class Iis7Website : BaseTask /// Sets the Enabled Protocols for the website /// public string EnabledProtocols { get; set; } - + + /// + /// Sets the SSl Flag for the website + /// + public string SslFlags { get; set; } + /// /// Sets AnonymousAuthentication for the website. Default is true /// @@ -196,7 +201,7 @@ public bool AnonymousAuthentication get { return this.anonymousAuthentication; } set { this.anonymousAuthentication = value; } } - + /// /// Sets DigestAuthentication for the website. Default is false; /// @@ -555,7 +560,15 @@ private void ProcessApplications() } this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "Setting additional settings for Application: {0}", app.ItemSpec)); + + // Set the authentification parameters Configuration config = this.iisServerManager.GetApplicationHostConfiguration(); + if (!string.IsNullOrEmpty(this.SslFlags)) + { + this.LogTaskMessage(string.Format(CultureInfo.CurrentCulture, "Setting SslFlags for Application: {0} - {1}", app.ItemSpec, this.SslFlags)); + ConfigurationSection accessSection = config.GetSection("system.webServer/security/access", this.Name + app.ItemSpec); + accessSection["sslFlags"] = this.SslFlags; + } if (!string.IsNullOrEmpty(app.GetMetadata("WindowsAuthentication"))) { @@ -878,4 +891,4 @@ private bool SiteExists() return this.website != null; } } -} +} \ No newline at end of file