Web_Application/.NET Core

The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure.

건빵쥔광이씨 2019. 9. 3. 13:08

.NET Core Console Application 개발 시 HTTPS 접근을 시도할 때 나타나는 예외 메세지 입니다.

        static void Main(string[] args)
        {
            ServicePointManager.ServerCertificateValidationCallback +=(sender, cert, chain, sslPolicyErrors) => true;  //추가

            string result = getData();  //구현
            Console.WriteLine("{0}", result);
        }

출처 : https://stackoverflow.com/questions/2675133/c-sharp-ignore-certificate-errors