ASPNet Core checks whether current connection is secured
using APS.net Core to mark all website pages working with https protocol we will do this using IAuthorizationFilter. and here is an example how we can do it. /// <summary> /// Represents a filter attribute that checks whether current connection is secured and properly redirect if necessary /// </summary> public class HttpsRequirementAttribute : TypeFilterAttribute { #region Fields private readonly SslRequirement _sslRequirement; #endregion #region Ctor /// <summary> /// Create instance of the filter attribute /// </summary> /// <param name="sslRequirement">Whether the page should be secured</param> public HttpsRequirementAttribute(SslRequirement sslRequirement) : base(typeof(HttpsRequirementFilter)) { this._sslRequirement = sslRequirement; this.Arguments = new object[] { sslRequirement }; }