Viewing cache items in MVC site - Could not establish trust relationship for the SSL/TLS secure chan

Chris Percival asked on April 11, 2024 17:53

I'm getting an error logged when attempting to view cache items on the live site (when running locally) from the url: /CMSModules/System/Debug/System_DebugCacheItems.aspx?livesitelogs=true

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

This is normally mitigated using <add key="CMSAcceptAllCertificates" value="true"/> but its not working in this case.

Any ideas?

Correct Answer

Juraj Ondrus answered on April 12, 2024 05:30

The key is mainly for the admin app but the live site cache items are coming from the live site app. I would recommend using valid SSL certificate for security reasons. If it is some testing or development environment, you can try workaround by adding the following line to either the Global.ascx.cs file in your admin project or in a custom module initialization/loader:

ServicePointManager.ServerCertificateValidationCallback = (request, cert, chain, errors) => true;

0 votesVote for this answer Unmark Correct answer

Recent Answers


Chris Percival answered on April 12, 2024 08:56

This purely for development on local machine. Adding the following code works, thank you. 👍

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.