Home > Net >  C # use HttpWebRequest send HTTPS requests, how to add a layer of SSL handshake packet header the us
C # use HttpWebRequest send HTTPS requests, how to add a layer of SSL handshake packet header the us

Time:05-15

Recently made a simulated in c # the browser receives the HTTPS web data tools, encounter problems card for several days, a great god give advice or comments, please, be obliged, all scores to send,
Caught tool fiddler fetching browser to access the HTTPS site data, will first have a HTTP handshake bag (presumably verification certificate, key, etc.), and then the HTTPS packets,
As shown in gray line:

The browser sends the handshake packet head looks something like this:
The CONNECT HTTP/1.1
www.hao123.com:443Host: www.hao123.com:443
Connection: keep alive -
The user-agent: Mozilla/5.0 (Windows NT 6.1; Win64. X64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
A SSLv3 - compatible ClientHello handshake was found. Fiddler extracted the parameters below.

C # use HttpWebRequest send package, there is no the user-agent to shake hands with this one, looked through the data, probably understood as the action of shaking hands is the underlying SSL encapsulation, the. Net framework and no interface to write it?
Note that I mean the connect to begin with, the HTTP protocol handshake this package, not shake hands after a successful get the HTTPS protocol, post the package,
Please the great god your advice, I thank you, here be obliged,
If this is the innate defect of c #, please to provide a direction to solve the problem, thank you...

CodePudding user response:

Add this item to look inside the header

CodePudding user response:

HttpWebRequest. UserAgent added in the first place, but it is only in the get and post with HTTPS package, at the beginning of the connect HTTP bag is,

CodePudding user response:

HttpWebRequest. Headers [] "the user-agent"="XXXXXXX";
Also tried, the c # does not support this method and can only use HttpWebRequest. UserAgent this,

CodePudding user response:

Brothers, I'm sorry, to late!!!!!!!!!! HttpWebRequest. UserAgent="XXXXXXX";

CodePudding user response:

The building Lord problem solved yet
  •  Tags:  
  • C#
  • Related