2 years ago

#70572

test-img

Kevin

Question on: ServicePointManager.ServerCertificateValidationCallback

Someone posted the code snippet here as a temporary workaround for accepting certificates. I would've followed up there but I don't have enough points to comment yet, so this has to be a new question.

As a total SSL neophyte, can anyone tell me where this snippet of code would go in a c# rest service? Does it go in startup.cs, program.cs, in the endpoint of the called service, or the method of the client that calls the service...

ServicePointManager.ServerCertificateValidationCallback +=
    (sender, cert, chain, sslPolicyErrors) => true;

ssl

certificate

0 Answers

Your Answer

Accepted video resources