【发布时间】:2016-02-18 04:20:32
【问题描述】:
我正在尝试在 WCF/.NET 版本 4.0 IIS 版本 7.5 中使用 SSL 证书身份验证,但是,当我启用 oneToOneMappings 身份验证时,系统无法识别 maxReceivedMessageSize,当我注释掉 oneToOneMappings 身份验证部分时,IIS 识别maxReceivedMessageSize 变量。
关于如何让这个 WCF 服务使用我在启用 SSL 证书身份验证时设置的 maxReceivedMessageSize 值有什么想法吗?
服务模型部分:
<system.serviceModel>
<services>
<service behaviorConfiguration="AServiceBehavior" name="<IContract>">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="MutualSslBinding" contract="<IContract>" name="AnEndpoint" />
<host><baseAddresses><add baseAddress="https://asite.com/service" /></baseAddresses></host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="AServiceBehavior">
<serviceCredentials>
</serviceCredentials>
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="true" />
<serviceSecurityAudit auditLogLocation="Security" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="MutualSslBinding" axReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport"> <transport clientCredentialType="Certificate" /></security>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
</system.serviceModel>
证书安全部分:
<system.webServer>
<security>
<access sslFlags="Ssl, SslNegotiateCert, SslRequireCert" />
<authentication>
<anonymousAuthentication enabled="true" />
<basicAuthentication enabled="false" />
<clientCertificateMappingAuthentication enabled="false" />
<digestAuthentication enabled="false" />
<windowsAuthentication enabled="false" />
<iisClientCertificateMappingAuthentication enabled="true" oneToOneCertificateMappingsEnabled="true" manyToOneCertificateMappingsEnabled="true">
<oneToOneMappings>
<clear />
<add userName="<LocalUser>" password="<EncryptedPassword>" certificate="<Authentication certificate text>" />
</oneToOneMappings>
</iisClientCertificateMappingAuthentication>
</authentication>
</security>
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="false" />
</system.webServer>
【问题讨论】:
标签: wcf authentication iis ssl