我的服务器代码(运行在AWS Lambda .net Core 3.1上)突然停止与我的API服务器进行身份验证。它已经运行了几年,但今天在生产和开发环境中同时停止工作。我收到的错误信息如下:
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
相关的源代码如下:
WebRequest httpWebRequest2 = WebRequest.Create(APIurl);
httpWebRequest2.Method = "GET";
httpWebRequest2.Accept = "application/json"
httpWebRequest2.Timeout = 60 * 1000
httpWebRequest2.Headers.Add("Authorization", _APIToken);
WebResponse response = httpWebRequest2.GetResponseAsync().Result;
我正在使用letsencrypt生成证书,我的开发API网址和生产API网址的证书都没有过期。在我尝试的其他所有平台上,HTTPS查询都成功了。
目前我甚至不知道还有什么可以排除故障。如果需要,我可以提供更多信息。