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
Solved: Could not establish trust relationship for the SSL/TLS secure channel :The underlying connection was closed2018-10-11T11:29:02+00:00

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

Viewing 1 post (of 1 total)
  • Author
    Posts
  • ScientistZ
    Keymaster
    Post count: 39

    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; };
    
    

    Official Microsoft Page

    For more information checkĀ 

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.