Я работал над следующим URL-адресом, чтобы попытаться выполнить безопасность безопасности WCF с использованием клиентских сертификатов на моей машине разработки (так что ящик служит клиентом и сервером).Безопасность безопасности WCF с использованием клиентских сертификатов
http://msdn.microsoft.com/en-us/library/ff648498.aspx
http://msdn.microsoft.com/en-us/library/ff650751.aspx
Моя среда Visual Studio 2008 на Windows 7 с IIS 7.5. Кажется, все хорошо, пока я не сделаю запрос на сервер, не открыв IE и не перейдя в один из моих файлов .svc или не запустив мое клиентское приложение Windows Form .NET и не позвонив в службу, после чего я получаю следующее сообщение об ошибке:
ошибка HTTP 403.7 - Запрещенный
страница, которую вы пытаетесь получить доступ, требует вашего браузера, чтобы иметь Secure Sockets Layer (SSL) сертификат клиента, что веб-сервер распознает.
сервер конфигурационный файл:
<bindings>
<wsHttpBinding>
<binding name="CertificateWithTransport" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="Certificate"></transport>
</security>
</binding>
</wsHttpBinding>
</bindings>
клиента конфигурационный файл:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="CertificateWithTransport" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="655360" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Certificate" realm="" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="clientCertificateConf">
<clientCredentials>
<clientCertificate
findValue="32 52 dc 36 e1 95 fb be 4e 3c f6 a6 92 13 53 f4 b5 32 47 45"
storeLocation="CurrentUser"
storeName="My"
x509FindType="FindByThumbprint" />
</clientCredentials>
<!--<clientCredentials>
<clientCertificate findValue="CN=localhostclient"
storeLocation="CurrentUser"
storeName="My"
x509FindType="FindBySubjectDistinguishedName" />
</clientCredentials>-->
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="https://localhost/Source.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="SourceServerReference.ISourceService" name="SourceService.wsHttp" />
<endpoint address="https://localhost/Community.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="CommunityServerReference.ICommunityService" name="CommunityService.wsHttp" />
<endpoint address="https://localhost/ActivityLeadContact.svc"
behaviorConfiguration="clientCertificateConf" binding="wsHttpBinding"
bindingConfiguration="CertificateWithTransport" contract="ActivityLeadContactServerReference.IActivityLeadContactService"
name="ActivityLeadContactService.wsHttp" />
<endpoint address="https://localhost/User.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="UserServerReference.IUserService" name="UserService.wsHttp" />
<endpoint address="https://localhost/PickListItem.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="PickListItemServerReference.IPickListItemService"
name="PickListItemService.wsHttp" />
<endpoint address="https://localhost/Prospect.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="ProspectServiceReference.IProspectService" name="ProspectService.wsHttp" />
<endpoint address="https://localhost/ActivityLead.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="ActivityLeadServiceReference.IActivityLeadService"
name="ActivityLeadService.wsHttp" />
<endpoint address="https://localhost/ActivityReferral.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="ActivityReferralServiceReference.IActivityReferralService"
name="ActivityReferralService.wsHttp" />
<endpoint address="https://localhost/Referral.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="CertificateWithTransport"
contract="ReferralServiceReference.IReferralService" name="ReferralService.wsHttp" />
<endpoint address="https://localhost/LeadService.svc" behaviorConfiguration="clientCertificateConf"
binding="wsHttpBinding" bindingConfiguration="LeadService.wsHttp"
contract="LeadServerReference.ILeadService" name="LeadService.wsHttp" />
</client>
</system.serviceModel>
</configuration>
Любая помощь будет принята с благодарностью!