none
WCF e SSL RRS feed

  • Pergunta

  • Estou fazendo um WCF para consumir um WebService que usa transporte seguro (certificado), quando a aplicação esta em modo de Debug (sem usar o IIS) funciona sem problemas, porem quando eu ponho a aplicação no IIS, ela me retorna que foi negado, pois nao posso usar o schema anonimo.

     

    System.ServiceModel.Security.MessageSecurityException: The HTTP request was forbidden with client authentication scheme 'Anonymous'

     

    alquem pode me ajudar.

     

    seque abaixo um as configurações do web.config

     

    <bindings>

    <basicHttpBinding>

    <binding name="BindingWs" closeTimeout="00:01:00" openTimeout="00:01:00"

    receiveTimeout="00:01:00" sendTimeout="00:01:00" allowCookies="false"

    bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

    useDefaultWebProxy="true">

    <readerQuotas maxDepth="32" maxStringContentLength="65536" maxArrayLength="16384"

    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

    <security mode="Transport">

    <transport clientCredentialType="Certificate" proxyCredentialType="Windows" />

    <message clientCredentialType="Certificate" algorithmSuite="Default" />

    </security>

    </binding>

    </basicHttpBinding>

    </bindings>

     

    <endpoint address="https://homologacao.nfe.sefaz.rs.gov.br/ws/nfestatusservico/NfeStatusServico.asmx"

    binding="basicHttpBinding" bindingConfiguration="BindingWs" behaviorConfiguration="customBehavior"

    contract="wsRSHStatusServico.NfeStatusServicoSoap" name="NfeStatusServicoSoap"/>

     

     

    <behaviors>

    <endpointBehaviors>

    <behavior name="customBehavior">

    <clientCredentials>

    <clientCertificate

    x509FindType="FindBySerialNumber"

    findValue="6b fb 7e 60 2a 07 36 70 ce d8 f2 3f f7 4e f5 b6"

    storeLocation="LocalMachine"

    storeName="My"/>

    <serviceCertificate>

    <authentication

    certificateValidationMode="ChainTrust"

    revocationMode="NoCheck"/>

    </serviceCertificate>

    </clientCredentials>

    </behavior>

    </endpointBehaviors>

    </behaviors>

    quinta-feira, 11 de dezembro de 2008 03:59

Respostas

Todas as Respostas