| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using System.Configuration; |
| | | 6 | | using CoreWCF.Channels; |
| | | 7 | | |
| | | 8 | | namespace CoreWCF.Configuration |
| | | 9 | | { |
| | | 10 | | public class HttpsTransportElement : HttpTransportElement |
| | | 11 | | { |
| | | 12 | | public override void ApplyConfiguration(BindingElement bindingElement) |
| | | 13 | | { |
| | 2 | 14 | | base.ApplyConfiguration(bindingElement); |
| | 2 | 15 | | HttpsTransportBindingElement binding = (HttpsTransportBindingElement)bindingElement; |
| | 2 | 16 | | binding.RequireClientCertificate = RequireClientCertificate; |
| | 2 | 17 | | } |
| | | 18 | | |
| | | 19 | | public override Type BindingElementType |
| | | 20 | | { |
| | 12 | 21 | | get { return typeof(HttpsTransportBindingElement); } |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | public override void CopyFrom(ServiceModelExtensionElement from) |
| | | 25 | | { |
| | 0 | 26 | | base.CopyFrom(from); |
| | | 27 | | |
| | 0 | 28 | | HttpsTransportElement source = (HttpsTransportElement)from; |
| | 0 | 29 | | RequireClientCertificate = source.RequireClientCertificate; |
| | 0 | 30 | | } |
| | | 31 | | |
| | | 32 | | protected override TransportBindingElement CreateDefaultBindingElement() |
| | | 33 | | { |
| | 2 | 34 | | return new HttpsTransportBindingElement(); |
| | | 35 | | } |
| | | 36 | | |
| | | 37 | | protected internal override void InitializeFrom(BindingElement bindingElement) |
| | | 38 | | { |
| | 0 | 39 | | base.InitializeFrom(bindingElement); |
| | 0 | 40 | | HttpsTransportBindingElement binding = (HttpsTransportBindingElement)bindingElement; |
| | 0 | 41 | | SetPropertyValueIfNotDefaultValue(ConfigurationStrings.RequireClientCertificate, binding.RequireClientCertif |
| | 0 | 42 | | } |
| | | 43 | | |
| | | 44 | | [ConfigurationProperty(ConfigurationStrings.RequireClientCertificate, DefaultValue = TransportDefaults.RequireCl |
| | | 45 | | public bool RequireClientCertificate |
| | | 46 | | { |
| | 2 | 47 | | get { return (bool)base[ConfigurationStrings.RequireClientCertificate]; } |
| | 0 | 48 | | set { base[ConfigurationStrings.RequireClientCertificate] = value; } |
| | | 49 | | } |
| | | 50 | | } |
| | | 51 | | } |