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:
-
J'ai créé une auto-signé le certificat d'autorité racine comme expliqué ici.
makecert -n "CN=TempCA" -r -sv TempCA.pvk TempCA.cer
-
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
-
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
-
Ajouté autorité de certification de Racine de Confiance Certificat
-
Ajouté ces certificats Personnels --> Certificats
-
Ajouté certificat du client à des Personnes de Confiance
-
Tout semble OK
-
Créé très simple application WCF. Ajouté IIS
-
Ajuster les paramètres de sécurité
-
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>
- 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>
- C'est mon client code et l'erreur
Ma question est comment puis-je passer cette erreur? J'ai besoin de votre aide.
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
Vous devez vous connecter pour publier un commentaire.
Au moins le problème a été trouvée. Quand j'ai regardé à l'intérieur de Journal des Événements de Windows, j'ai vu que l'erreur
J'ai soutenu un certain nombre d'actes et de les supprimer. Après cette opération, mon programme fonctionne.
OriginalL'auteur Omer K