none
When I try to call an enterprise WDSL from the application I built The remote certificate validation procedure has failed. Could not Establish trust relationship with remote server.The remote certificate validation procedure has failed.Could not Establish RRS feed

  • Question

  • trust relationship with remote server

    the full information is below:

    SforceService: Private sfdcServ As New sfdcWS.SforceService
    The web service instance: Me.sfdcServ = New sfdcWS.SforceService
    Service attributes are assigned: sfdcServ.Url = loginRes.serverUrl
    sfdcServ.SessionHeaderValue = New sfdcWS.SessionHeader
    sfdcServ.SessionHeaderValue.sessionId = loginRes.sessionId
    It connects (ok): Me.loginRes = sfdcServ.login (Me.admin, Me.pwd)
    A query defined: qryStr = 'SQL Statement'
    The query is executed: qryResult = sfdcServ.query (qryStr)
    An exception is: System.Net.WebException = {"Could not Establish trust relationship with remote server"}
    InnerException = {"The remote certificate validation procedure has failed."}
    Message = "Could not Establish trust relationship with remote server"
    StackTrace =
    in System.Net.HttpWebRequest.finishGetResponse ()}
    in System.Net.HttpWebRequest.GetResponse ()
    in System.Web.Services.Protocols.WebClientProtocol.GetWebResponse (WebRequest request)
    in System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse (WebRequest request)
    in System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke (String methodName, Object [] parameters, WebClientAsyncResult asyncResult)
    in System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (String methodName, Object [] parameters)

    Saturday, May 30, 2015 7:51 AM

Answers

  • Hi Cesar Adames,
      According to this case, you need to install the certificate of the web server on your machine, which hosts the client. Depending on the issuer of the certificate it may be required to install the whole certificate chain on your machine too.
      During  the testing environment sometimes might not satisfy high security policy. In general, the underlying infrastructure can mostly fail because of following problems :
    1. The certificate is not from a trusted authority. This happens if the issuing authority is not trusted by the Certificate Manager. For testing, you can issue your own certificates and add yourself to the trusted authorities list. For production, you should probably buy a certificate

    2. The date on the certificate is invalid. The certificate's dates don't match those on the client computer. If this happens only on some computers, check that the clock on the offending computers is set to the right day.

    3. Sometimes the remote certificate is invalid according to the validation procedure ,Click here to refer the troubleshooting steps.

    4.Moreover when accessing a secure WSDL and the server certificate is not trusted by .Net Framework, for example, when using self signed certificates.If you paste the URL of the WSDL into Internet Explorer you should see the certificate warning "The certificate cannot be verified up to a trusted certification authority". 

    • Goto Internet Explorer
    • Select TOOLS >> INTERNET OPTIONS >> CONTENT TAB >> CERTIFICATES
    • Select the Trusted Root Certificate Authorities tab
    • Select IMPORT>> NEXT>> BROWSE
    • Browse to the CA certificate on your disk
    • Ensure that the Place all certificates in the following store is selected and set to Trusted Root Certificate Authorities
    • select NEXT >> FINISH >> CLOSE
    Monday, June 1, 2015 6:17 AM