IIS hébergé WCF avec le système de sécurité SSL -“La requête HTTP a été interdit par le schéma d'authentification client 'Anonyme'” erreur

Je suis en train d'hôte wcf sur IIS à l'aide de la sécurité des transports. J'ai trouvé un bon tuto et suivez les instructions : http://robbincremers.me/2011/12/27/wcf-transport-security-and-client-certificate-authentication-with-self-signed-certificates/. Je suis toujours "La requête HTTP a été interdit par le schéma d'authentification client "Anonyme"". Comment puis-je gérer cela?

Ce que j'ai fait jusqu'à présent est:

  1. J'ai créé une auto-signé le certificat d'autorité racine comme expliqué ici.

    makecert -n "CN=TempCA" -r -sv TempCA.pvk TempCA.cer

  2. Créé un nouveau certificat de serveur signé par un certificat d'autorité racine

    makecert -sk SignedByCA -iv TempCA.pvk -n "CN=localhost" -ic TempCA.cer localhost.cer-sr localmachine -ss Mon

  3. Créé un nouveau client certificat signé par un certificat d'autorité racine

    makecert -sk SignedByCA -iv TempCA.pvk -n "CN=clientCert" -ic TempCA.cer clientCert.cer-sr localmachine -ss Mon

  4. Ajouté autorité de certification de Racine de Confiance Certificat

    IIS hébergé WCF avec le système de sécurité SSL -“La requête HTTP a été interdit par le schéma d'authentification client 'Anonyme'” erreur

  5. Ajouté ces certificats Personnels --> Certificats
    IIS hébergé WCF avec le système de sécurité SSL -“La requête HTTP a été interdit par le schéma d'authentification client 'Anonyme'” erreur

  6. Ajouté certificat du client à des Personnes de Confiance
    IIS hébergé WCF avec le système de sécurité SSL -“La requête HTTP a été interdit par le schéma d'authentification client 'Anonyme'” erreur

  7. Tout semble OK
    IIS hébergé WCF avec le système de sécurité SSL -“La requête HTTP a été interdit par le schéma d'authentification client 'Anonyme'” erreur

  8. Créé très simple application WCF. Ajouté IIS
    IIS hébergé WCF avec le système de sécurité SSL -“La requête HTTP a été interdit par le schéma d'authentification client 'Anonyme'” erreur

  9. Ajuster les paramètres de sécurité
    IIS hébergé WCF avec le système de sécurité SSL -“La requête HTTP a été interdit par le schéma d'authentification client 'Anonyme'” erreur

  10. C'est mon service web.fichier de configuration

> <?xml version="1.0"?> <configuration>   <system.web>
>     <compilation debug="true" targetFramework="4.5" />
>     <httpRuntime targetFramework="4.5"/>   </system.web>   <system.serviceModel>
>     <bindings>
>       <basicHttpBinding>
>         <binding name="EmployeeBindingConfig">
>           <security mode="Transport">
>             <transport clientCredentialType="Certificate" />
>           </security>
>         </binding>
>       </basicHttpBinding>
>     </bindings>
>     <behaviors>
>       <serviceBehaviors>
>         <behavior name="EmployeeServiceBehavior">
>           <serviceMetadata httpsGetEnabled="true"/>
>           <serviceDebug includeExceptionDetailInFaults="true"/>
>           <serviceCredentials>
>             <clientCertificate>
>               <authentication certificateValidationMode="PeerOrChainTrust"
> trustedStoreLocation="LocalMachine" />
>             </clientCertificate>
>           </serviceCredentials>
>         </behavior>
>       </serviceBehaviors>
>     </behaviors>
>     <services>
>       <service
>         behaviorConfiguration="EmployeeServiceBehavior"
>         name="WCF.Tutorial.TransportSecurity.ServiceNew.EmployeeService">
>         <host>
>           <baseAddresses>
>             <add baseAddress="https://localhost/WCF.Tutorial.TransportSecurity.ServiceNew"/>
>           </baseAddresses>
>         </host>
>         <endpoint address="EmployeeService"
>                   binding="basicHttpBinding"
>                   bindingConfiguration="EmployeeBindingConfig"
>                   contract="WCF.Tutorial.TransportSecurity.ServiceNew.IEmployeeService"
> />
>         <endpoint
>            address="mex"
>            binding="mexHttpsBinding"
>            contract="IMetadataExchange" />
>       </service>
>     </services>   </system.serviceModel>   <system.webServer>
>     <modules runAllManagedModulesForAllRequests="true"/>   </system.webServer> </configuration>
  1. C'est mon client app.config
>     <?xml version="1.0" encoding="utf-8" ?>
>     <configuration>
>         <startup> 
>             <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
>         </startup>
>       <system.serviceModel>
>         <behaviors>
>           <endpointBehaviors>
>             <behavior name="EmployeeEndpointBehaviour">
>               <clientCredentials>
>                 <clientCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="omer-HP"/>
>               </clientCredentials>
>             </behavior>
>           </endpointBehaviors>
>         </behaviors>
>         <bindings>
>           <basicHttpBinding>
>             <binding name="EmployeeBindingConfig">
>               <security mode="Transport">
>                 <transport clientCredentialType="Certificate" />
>               </security>
>             </binding>
>           </basicHttpBinding>
>         </bindings>
>         <client>
>           <endpoint address="https://localhost/WCF.Tutorial.TransportSecurity.ServiceNew/EmployeeService.svc"
>                     binding="basicHttpBinding" bindingConfiguration="EmployeeBindingConfig"
>             contract="WCF.Tutorial.TransportSecurity.ServiceNew.IEmployeeService"
> name="serviceEndpoint"
> behaviorConfiguration="EmployeeEndpointBehaviour"/>
>         </client>
>       </system.serviceModel>
>     </configuration>
  1. C'est mon client code et l'erreur
    IIS hébergé WCF avec le système de sécurité SSL -“La requête HTTP a été interdit par le schéma d'authentification client 'Anonyme'” erreur

Ma question est comment puis-je passer cette erreur? J'ai besoin de votre aide.

Je ne pouvais pas ajouter de fichiers de configuration que l'extrait de code. Le site ne montre pas les lignes j'ai donc dû ajouter une image.
Les captures d'écran que nous ne pouvons pas lire le texte dans les images (ou je ne peux pas les lire), et nous ne pouvons pas rechercher du texte important (comme x509FindType=FindBySubjectName).
enfin je pourrais ajouter les codes, veuillez passer en revue.

OriginalL'auteur Omer K | 2014-08-18