2-way SSL authontication ..клиент wpf и служба WCF
Привет команда,
Я разрабатываю приложение в WPF и хочу подключить службу wcf через 2-стороннюю ssl-аутентификацию..
I have generated client-server certificate and pfx file.
У меня есть сертификат службы импорта в IIS и сертификат клиента в корне консоли.
но все же я получаю много ошибок, таких как
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''.
это моя конфигурация на стороне клиента
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IBTA_Service"> <security mode="Transport"> <transport clientCredentialType="Certificate" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="https://172.16.50.146:12466/BTA_Service.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IBTA_Service" contract="BTA_Service.IBTA_Service" name="WSHttpBinding_IBTA_Service " behaviorConfiguration="EndpointBehavior" /> </client> <behaviors> <endpointBehaviors> <behavior name="EndpointBehavior"> <clientCredentials> <clientCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" findValue="3a396124e4435f661d8b211ea5ae118c132f5b34"/> </clientCredentials> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> </configuration>
Конфигурация уровня обслуживания
<?xml version="1.0"?> <configuration> <!--<system.diagnostics> <sources> <source propagateActivity="true" name="System.ServiceModel" switchValue="Warning,ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelTraceListener"> <filter type="" /> </add> </listeners> </source> </sources> <sharedListeners> <add initializeData="d:\gallello\gallellomvc\bta_wcf_service\web_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp"> <filter type="" /> </add> </sharedListeners> </system.diagnostics>--> <system.web> <compilation debug="true" targetFramework="4.5"/> <pages controlRenderingCompatibilityVersion="4.0"/> </system.web> <connectionStrings> <add name="GDS_Connection" connectionString="F5XGWMkZIKnvmeKRLmDIs85gfShEhVsCb31D96JcpdLpltZWV3RBdpfwwCVPeOPz5EcrGS0/6c2N/s3sV9TIiNokGMnzuptigq6kJQHbpAWo6G0mBWlIag=="/> </connectionStrings> <system.serviceModel> <services> <service name="BTA_WCF_Service.BTA_Service"> <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="BTA_WCF_Service.IBTA_Service" /> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> </service> </services> <bindings> <wsHttpBinding> <binding name="TransportSecurity"> <security mode="Transport"> <transport clientCredentialType="Certificate"/> </security> </binding> </wsHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpsGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="false"/> <serviceCredentials> <serviceCertificate storeLocation="LocalMachine" x509FindType="FindBySubjectDistinguishedName" storeName="My" findValue="localhost"/> </serviceCredentials> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="True"/> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> <!-- To browse web app root directory during debugging, set the value below to true. Set to false before deployment to avoid disclosing web app folder information. --> <directoryBrowse enabled="true"/> </system.webServer> </configuration>
Пожалуйста, дайте мне краткое объяснение и демонстрационное решение для того же самого..
Что я уже пробовал:
ОШИБКА :-
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was ''..
Пожалуйста, объясните мне весь процесс 2-сторонней ssl-аутентификации