summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId/Configuration/HostMetaDiscoveryElement.cs
blob: 437b12f2e17bc32af73fe578303c54c9cd8c839e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//-----------------------------------------------------------------------
// <copyright file="HostMetaDiscoveryElement.cs" company="Andrew Arnott">
//     Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOpenAuth.Configuration {
	using System.Configuration;

	/// <summary>
	/// The configuration element that can adjust how hostmeta discovery works.
	/// </summary>
	internal class HostMetaDiscoveryElement : ConfigurationElement {
		/// <summary>
		/// The property name for enableCertificateValidationCache.
		/// </summary>
		private const string EnableCertificateValidationCacheConfigName = "enableCertificateValidationCache";

		/// <summary>
		/// Initializes a new instance of the <see cref="HostMetaDiscoveryElement"/> class.
		/// </summary>
		public HostMetaDiscoveryElement() {
		}

		/// <summary>
		/// Gets or sets a value indicating whether validated certificates should be cached and not validated again.
		/// </summary>
		/// <remarks>
		/// This helps to avoid unexplained 5-10 second delays in certificate validation for Google Apps for Domains that impact some servers.
		/// </remarks>
		[ConfigurationProperty(EnableCertificateValidationCacheConfigName, DefaultValue = false)]
		public bool EnableCertificateValidationCache {
			get { return (bool)this[EnableCertificateValidationCacheConfigName]; }
			set { this[EnableCertificateValidationCacheConfigName] = value; }
		}
	}
}