Ejemplo n.º 1
0
        public static HealthCheckBuilder AddX509CertificateCheck(this HealthCheckBuilder builder, IConfiguration configuration)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            var options = new X509CertificateCheckOptions();

            configuration.Bind(options);

            return(builder.AddX509CertificateCheck(options));
        }
Ejemplo n.º 2
0
        public static HealthCheckBuilder AddX509CertificateCheck(this HealthCheckBuilder builder, X509CertificateCheckOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var settings = new X509CertificateCheckSettings(options.Name, options.Critical, options.Frequency, options.Tags, options.Thumbprint, options.StoreName, options.StoreLocation, options.ExpirationOffsetInMinutes);

            return(builder.AddX509CertificateCheck(settings));
        }