저는 인터넷 검색을 통해 제가 찾거나 생각할 수있는 모든 솔루션을 시도해 왔습니다. 로드하려는 사이트는 TLS1.2 문제가 아닌지 확인하기 위해 테스트를 시도한 몇 가지 다른 사이트와 마찬가지로 TLS1.2를 실행하고 있습니다. 다른 사이트는 잘로드되었습니다.
byte[] buffer = Encoding.ASCII.GetBytes(
"mod=www&ssl=1&dest=account_settings.ws"
+ "&username=" + username.Replace(" ", "20%")
+ "&password=" + password.Replace(" ", "20%"));
ServicePointManager.MaxServicePointIdleTime = 1000;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
HttpWebRequest WebReq =
(HttpWebRequest)WebRequest.Create(
"https://secure.runescape.com/m=weblogin/login.ws");
WebReq.Method = "POST";
WebReq.KeepAlive = false;
WebReq.Referer =
"https://secure.runescape.com/m=weblogin/loginform.ws"
+ "?mod=www&ssl=1&expired=0&dest=account_settings.ws";
WebReq.ContentType = "application/x-www-form-urlencoded";
WebReq.ContentLength = buffer.Length;
Stream PostData = WebReq.GetRequestStream();
PostData.Write(buffer, 0, buffer.Length);
PostData.Close();
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
Stream Answer = WebResp.GetResponseStream();
StreamReader _Answer = new StreamReader(Answer);
reply = _Answer.ReadToEnd();
curAccount++;
if (reply.Contains("Login Successful"))
{
eturn true;
}
else
{
eturn false;
}
내가 무엇을 시도해도 계속 예외가 발생합니다.
기본 연결이 닫혔습니다. 전송시 예기치 않은 오류가 발생했습니다.
자세한 내용은 아래에서
원격 당사자가 전송 스트림을 닫았 기 때문에 인증에 실패했습니다.
.Net 프레임 워크의 4.0 버전에서는 다음 두 가지 옵션ServicePointManager.SecurityProtocol
만 설정했습니다.
프레임 워크의 다음 릴리스에서 SecurityProtocolType
열거자는 최신 Tls 프로토콜로 확장되었으므로 애플리케이션이 4.5 버전을 사용할 수있는 경우 다음을 사용할 수도 있습니다.
따라서 .Net 4.5를 사용하는 경우 라인을 변경하십시오.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
...에
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager는 Tls12 연결을 지원하는 스트림을 만듭니다.
열거 형 값을 플래그로 사용할 수 있으므로 여러 프로토콜을 논리적 OR과 결합 할 수 있습니다.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls |
SecurityProtocolType.Tls11 |
SecurityProtocolType.Tls12;
참고
지원하는 프로토콜의 수를 가능한 한 적게 유지하고 현재 보안 표준을 최신 상태로 유지하십시오. Ssll3는 더 이상 안전한 것으로 간주되지 않으며 Tls1.0의 사용이 SecurityProtocolType.Tls
감소하고 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다