关于WCF wsHttpBinding,
[从另一方收到未进行安全处理或安全处理不正确的错误。有关错误代码和详细信息,请参见内部 FaultException.]
报出了这个错误.
相关设置如下:
config 配置如下:(XX.XX.X.11 为IP地址.为安全保密,X代替)
XX.XX.X.11 这个证书为不可信任机关发行的. 跟机器IP同名
把 XX.XX.X.11的服务器 换成 XX.XX.X.12 的服务器 ,证书换成 XX.XX.X.12
同样是不可信任机关发行的.跟机器IP同名,却可以
求帮助!
Service config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service
name="WCF.MyService"
behaviorConfiguration="MyServicebehavior">
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration="MyServiceBinding"
contract="WCF.IMyService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="MyServiceBinding">
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyServicebehavior">
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="None" />
</clientCertificate>
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="WCF.CustomUserNameValidator,WCF" />
<serviceCertificate findValue="XX.XX.X.11" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
</serviceCredentials>
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.web>
<trust level="Full" />
<customErrors mode="Off"/>
</system.web>
</configuration>
client config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>