c# - How do I tell WCF to skip verification of the certificate from client .NET and web service JAVA? -
i have build silmple client in c# call soap java web service. have problem validation response. problem (i think) on certificate.
this 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="disableservicecertificatevalidation"> <clientcredentials> <servicecertificate> <authentication certificatevalidationmode="none" revocationmode="nocheck" trustedstorelocation="localmachine"/> </servicecertificate> </clientcredentials> </behavior> </endpointbehaviors> </behaviors> <bindings> <custombinding> <binding name="mynewservice"> <security defaultalgorithmsuite="basic128" authenticationmode="mutualcertificate" requirederivedkeys="false" securityheaderlayout="lax" includetimestamp="true" messageprotectionorder="signbeforeencrypt" messagesecurityversion="wssecurity10wstrustfebruary2005wssecureconversationfebruary2005wssecuritypolicy11basicsecurityprofile10" requiresignatureconfirmation="false" enableunsecuredresponse="false"> <localclientsettings detectreplays="true"/> <localservicesettings detectreplays="true"/> </security> <textmessageencoding messageversion="soap11wsaddressing10"/> <httpstransport/> </binding> </custombinding> </bindings> <servicehostingenvironment multiplesitebindingsenabled="true" aspnetcompatibilityenabled="true" /> <client> <endpoint address="https://edottotest.sanita.regione.rsr.rupar.puglia.it/nsisr/pianoassistenzialeresidenzialeservice" binding="custombinding" bindingconfiguration="mynewservice" contract="pianoassistenzialeresidenzialeservice.pianoassistenzialeresidenziale" name="pianoassistenzialeresidenzialeport" behaviorconfiguration="disableservicecertificatevalidation"/> </client> </system.servicemodel> </configuration>
this code have build:
pianoassistenzialeresidenzialeclient ws_client = new pianoassistenzialeresidenzialeclient("pianoassistenzialeresidenzialeport", "https://edottotest.sanita.regione.rsr.rupar.puglia.it/nsisr/pianoassistenzialeresidenzialeservice"); ws_client.clientcredentials.clientcertificate.certificate=certificatolocale; ws_client.clientcredentials.servicecertificate.defaultcertificate = certificatolocale; ws_client.clientcredentials.servicecertificate.authentication.certificatevalidationmode = x509certificatevalidationmode.none; endpointidentity identity = endpointidentity.creatednsidentity("healthnetbr"); endpointaddress address = new endpointaddress(new uri("https://edottotest.sanita.regione.rsr.rupar.puglia.it/nsisr/pianoassistenzialeresidenzialeservice"), identity); ws_client.endpoint.address = address; ws_client.getelencopaidomiciliare(attributi, request);
but when try call web service, have error @ validation certificate. now, how can disable validation?
Comments
Post a Comment