wcf - getting "Could not establish trust relationship for the SSL/TLS secure channel with authority" when running fiddler -
i have wcf client application sends https request third-party webservice. everythings works well. receive correct answer.
i have installed fiddler , trusted rootcertificate capture , encode https traffic. requests recieve error "could not establish trust relationship ssl/tls secure..."
i have searched lot on error on web. each time solution need trust fiddler root certificate. since have done het start, looks not solution problem.
here snippet out of code sends request:
asymmetricsecuritybindingelement securitybindingelement = new asymmetricsecuritybindingelement(); securitybindingelement.initiatortokenparameters = new x509securitytokenparameters { inclusionmode = securitytokeninclusionmode.never }; securitybindingelement.recipienttokenparameters = new x509securitytokenparameters(); securitybindingelement.enableunsecuredresponse = true; securitybindingelement.endpointsupportingtokenparameters.signed.add(new x509securitytokenparameters()); custombinding binding = new custombinding(securitybindingelement, new textmessageencodingbindingelement(messageversion.soap11, encoding.utf8), new httpstransportbindingelement()); endpointaddress endpoint = new endpointaddress(new uri(url), new x509certificateendpointidentity(servercertificate)); channelfactory<type> channelfactory = new channelfactory<type>(binding, endpoint); channelfactory.credentials.clientcertificate.certificate = clientx509certificaat; channelfactory.credentials.servicecertificate.authentication.revocationmode = x509revocationmode.nocheck; channelfactory.endpoint.contract.protectionlevel = protectionlevel.sign; type client = channelfactory.createchannel(); client.request();
somebody knows what going wrong here?
i changed code to:
asymmetricsecuritybindingelement securitybindingelement = new asymmetricsecuritybindingelement(); securitybindingelement.initiatortokenparameters = new x509securitytokenparameters { inclusionmode = securitytokeninclusionmode.never }; securitybindingelement.recipienttokenparameters = new x509securitytokenparameters(); securitybindingelement.enableunsecuredresponse = true; securitybindingelement.endpointsupportingtokenparameters.signed.add(new x509securitytokenparameters()); custombinding binding = new custombinding(securitybindingelement, new textmessageencodingbindingelement(messageversion.soap11, encoding.utf8), new httpstransportbindingelement()); endpointaddress endpoint = new endpointaddress(new uri(url)); channelfactory<type> channelfactory = new channelfactory<type>(binding, endpoint); channelfactory.credentials.clientcertificate.certificate = clientx509certificaat; channelfactory.credentials.servicecertificate.defaultcertificate = serverx509certificaat; channelfactory.endpoint.contract.protectionlevel = protectionlevel.sign; type client = channelfactory.createchannel(); client.request();
it not clear me why not have problems anymore. anyone?
Comments
Post a Comment