0

I have the following situation - i call remote service, written on Java from my WCF-client. This service has a certificate-based authentication, using SSL, and giving to all clients certificates in JKS format. I converted this certificate to P12 format and called to service. Сall does not raised an exception, but returned empty result.

Client-proxy i'm generated from service WSDL. Here is my 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="ClientEndPointBehavior">
          <clientCredentials>            
            <clientCertificate storeLocation="CurrentUser" storeName="My" x509FindType="FindBySerialNumber" findValue="01234567"/>
          </clientCredentials>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="MyBinding" allowCookies="true">
          <security mode="Transport">
            <transport clientCredentialType="Certificate"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>     
      <endpoint address="https://myservice/services/"
          binding="basicHttpBinding" bindingConfiguration="MyBinding"
          contract="IContract" name="Contract"  behaviorConfiguration="ClientEndPointBehavior"/>
    </client>
  </system.serviceModel>  
</configuration>

What i'm doing wrong?

brewerof
  • 92
  • 2
  • 7
  • Start WCF tracing refer [link](http://stackoverflow.com/questions/4271517/how-to-turn-on-wcf-tracing). This would give some more information – dera May 05 '14 at 11:21
  • Can you get SSL working without the client cert authentication? If the SSl works, but the cert authentication doesn't, at least you know where your problem lies. The SSL and cert authentication are two separate functions. They can work apart from each other. – Brian May 05 '14 at 13:10
  • I changed binding from basicHttpBinding to wsHttpBinding and got exception about bindings mismatch, but anyway i got some data from service! Could it be that WCF simply don't allow transfer any encrypted data using basicHttpBinding? – brewerof May 05 '14 at 13:25

1 Answers1

0

You would have to use CustomBinding for interoperability with java client or services.You could try any of the below bindings based on your mode of Authentication.

<customBinding>
<binding name="bindingName">
  <textMessageEncoding messageVersion="Soap11" />
  <httpsTransport authenticationScheme="Anonymous"         
                  requireClientCertificate="true" />
</binding>

Try different authenticationScheme for the above

OR

<customBinding>
<binding name="bindingName">
  <textMessageEncoding messageVersion="Soap11" />
  <security authenticationMode="CertificateOverTransport" />
  <httpsTransport requireClientCertificate="true"/>
</binding>

Please refer link for different options on authenticationMode

Hope this helps

dera
  • 401
  • 2
  • 4