Sep 3, 2019 09:57 AM
(This post was last modified: Sep 3, 2019 09:58 AM by draxyee.)
Hi,
I am getting this error upon sending this request:
"Authentication failed because the remote party has closed the transport stream"
I have tried almost everything but nothing helps. (links have been replaced with [dot] - full code; pastebin . com/raw/ZbieRH56
Hopefully someone can help me with this!
Draxyee
I am getting this error upon sending this request:
"Authentication failed because the remote party has closed the transport stream"
Code
public static bool RegisterAccount(Account acc, CookieContainer ck)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
System.Net.ServicePointManager.Expect100Continue = false;
HttpWebRequest registerReq = WebRequest.CreateHttp("chaturbate[dot]com/accounts/register/?");
registerReq.Method = "POST";
string[] MaleFemale = { "M", "F" };
string postData = string.Format("csrfmiddlewaretoken={0}&username={1}&password={2}&email={3}&birthday_month={4}&birthday_day={5}&birthday_year={6}&gender={7}&g-recaptcha-response={8}&terms=on&privacy_policy=on&studio=&redeem_code=",
acc.CsrfToken, acc.Username, acc.Password, acc.Email, acc.rnd.Next(0, 9), acc.rnd.Next(0, 9), acc.rnd.Next(1950, 1999), MaleFemale[acc.rnd.Next(0,1)], acc.RecaptchaToken);
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
registerReq.ProtocolVersion = HttpVersion.Version11;
registerReq.Host = "chaturbate[dot]com";
registerReq.KeepAlive = true;
registerReq.ContentLength = postData.Length;
registerReq.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3";
registerReq.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36";
registerReq.ContentType = "application/x-www-form-urlencoded";
registerReq.Referer = "chaturbate[dot]com/";
registerReq.Headers.Add("Cache-Control", "max-age=0");
registerReq.Headers.Add("Origin", "chaturbate[dot]com");
registerReq.Headers.Add("Upgrade-Insecure-Requests", "1");
registerReq.Headers.Add("Sec-Fetch-Mode", "navigate");
registerReq.Headers.Add("Sec-Fetch-User", "?1");
registerReq.Headers.Add("Sec-Fetch-Site", "same-origin");
if (acc.Proxy == null) { registerReq.Proxy = acc.Proxy; }
registerReq.CookieContainer = ck;
postData = HttpUtility.UrlEncode(postData);
Stream dataStream = registerReq.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
HttpWebResponse resp = (HttpWebResponse)registerReq.GetResponse();
if (resp.StatusCode == HttpStatusCode.Found) { return true; } else { return false; }
}I have tried almost everything but nothing helps. (links have been replaced with [dot] - full code; pastebin . com/raw/ZbieRH56
Hopefully someone can help me with this!
Draxyee



![[Image: Syr3DlV.png]](https://i.imgur.com/Syr3DlV.png)

![[Image: vp6iypF.gif]](https://i.imgur.com/vp6iypF.gif)

![[Image: logo.gif]](https://datap.pro/threadimage/logo.gif)