내 웹 서버의 한 특정 웹 사이트에서 WebRequests가 다음 오류를 발생시키기 시작했습니다. "기본 연결이 닫혔습니다: 보내기 시 예기치 않은 오류가 발생했습니다."
요청 코드:
Dim myReq As System.Net.WebRequest = System.Net.WebRequest.Create("https://example.com")
myReq.Method = "GET"
myReq.ContentType = "text/html; encoding='utf-32'"
Dim wr As System.Net.WebResponse = myReq.GetResponse()
Dim receiveStream As System.IO.Stream = wr.GetResponseStream()
Dim reader As System.IO.StreamReader = New System.IO.StreamReader(receiveStream, Encoding.UTF8)
Dim content As String = reader.ReadToEnd()
요청을 수행하는 페이지와 global.asax에 다음을 추가하려고 시도했지만 작동하지 않았습니다. .net 4.8을 사용하고 있기 때문에 필요하지 않습니다.
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
의견에서 언급했듯이 이것은 종종 내부 DNS 또는 HOSTS 파일 항목의 문제입니다. 서버가 사이트의 도메인을 잘못된 내부 주소로 확인하거나 사이트의 공용 주소에 액세스하려고 시도하고 라우터를 혼동합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다