>>Solved: Could not establish trust relationship for the SSL/TLS secure channel :The underlying connection was closed
Solved: Could not establish trust relationship for the SSL/TLS secure channel :The underlying connection was closed 2018-02-26T14:07:20+00:00

Home Forums WebServices WCF Asmx WebApi Solved: Could not establish trust relationship for the SSL/TLS secure channel :The underlying connection was closed

  • Author
    Posts
  • Muhammad Zaheer
    Keymaster
    Post count: 18

    Solved: Could not establish trust relationship for the SSL/TLS secure channel :The underlying connection was closed

    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

    System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

     

    Solution: This problem comes when the SSL certificate of the service which is being consumed is not valid or expired or not from trusted source. To eliminate this issue temporarily you just need to add below code before method call.

    It is not recommended to do it on production as it will accept all invalid/Expired certificates.

    System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

     

You must be logged in to reply to this topic.