【发布时间】:2015-07-18 02:16:57
【问题描述】:
我有自托管的 WCF 服务和数千个客户端安装。 新服务器证书具有不同的 DNS 名称(*.mydomain.com 而不是 mydomain.com),这就是 DNS 身份停止工作的原因。有没有办法通过仅更改服务器端代码/配置来取消证书验证?
客户
var binding = new NetTcpBinding
{
Security =
{
Mode = SecurityMode.Transport,
Transport = {ClientCredentialType = TcpClientCredentialType.None}
}
};
_proxyClientHost = new ChannelFactory<IMyClientApp>(binding,
new EndpointAddress(new Uri("myservice.mydomain.com"),
EndpointIdentity.CreateDnsIdentity("*.mydomain.com")));
服务器
_serviceHost = new ServiceHost(typeof(MyClientApp));
_serviceHost.Credentials.ServiceCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My, X509FindType.FindByThumbprint, "Certificate ThmubPrint Value …");
_serviceHost.Open();
服务器配置:
服务部分:
<service behaviorConfiguration="serviceBehavior"
name="MyService ">
<endpoint
binding="netTcpBinding"
bindingConfiguration="netTcpSettings"
name="netTcpEP"
contract="MyContract" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://mycomuter:333" />
</baseAddresses>
</host>
</service>
行为:
<behavior name="serviceBehavior">
<serviceDebug includeExceptionDetailInFaults="True" httpHelpPageEnabled="false" />
<serviceThrottling maxConcurrentCalls="32" maxConcurrentSessions="30" maxConcurrentInstances="2147483647" />
</behavior>
绑定:
<binding name="netTcpSettings" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security>
<transport clientCredentialType="None">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="Windows" algorithmSuite="TripleDesSha256" />
</security>
</binding>
【问题讨论】:
标签: c# wcf ssl dns certificate