[Mono-dev] WCF basicHttpBinding with certificate based authentication fails

Andreas Mack andreas.mack at zkrd.de
Wed Jun 20 13:40:19 UTC 2012


Hello,

I have successfully implemented and tested a simple wcf 'hello world'
service with basicHttpBinding on Mono 2.10.8.

If i try to limit the access via certificate based authentication i get
the following error (browser):

"When Message security is enabled in a BasicHttpBinding, the message
security credential type must be
BasicHttpMessageCredentialType.Certificate." (Error 500)

This is the relevant part of my Web.config:

   <system.serviceModel>

      <services>
         <service name="WcfBeispiel.HelloService"
                  behaviorConfiguration="MyServiceTypeBehaviors">
            <endpoint address=""
                      binding="basicHttpBinding"
                      bindingConfiguration="MyServiceBindingConfiguration"
                      contract="WcfBeispiel.IHelloService" />
            <endpoint contract="IMetadataExchange"
binding="mexHttpBinding" address="mex" />
         </service>
      </services>

      <behaviors>
         <serviceBehaviors>
            <behavior name="MyServiceTypeBehaviors">
               <serviceMetadata httpGetEnabled="true"/>
               <serviceDebug includeExceptionDetailInFaults="false"/>
               <serviceCredentials>
                  <serviceCertificate findValue     = "optimastest.zkrd.de"
                                      storeLocation = "LocalMachine"
                                      storeName     = "My"
                                      x509FindType  = "FindBySubjectName" />
                  <clientCertificate>
                     <authentication
certificateValidationMode="ChainTrust" />
                  </clientCertificate>
               </serviceCredentials>
            </behavior>
         </serviceBehaviors>
      </behaviors>
      <!--<serviceHostingEnvironment multipleSiteBindingsEnabled="true"
/>-->

      <bindings>
         <basicHttpBinding>
            <binding name="MyServiceBindingConfiguration" >
               <security mode = "Message">
                  <message clientCredentialType="Certificate"/>
               </security>
            </binding>
         </basicHttpBinding>
      </bindings>

   </system.serviceModel>

Where should i set the message security credential type to
BasicHttpMessageCredentialType.Certificate if not in the bindings section?

Any help would be greatly appreciated!


More information about the Mono-devel-list mailing list