Home > Software engineering >  Setting the winhttp Windows 7 tls1.2 failed
Setting the winhttp Windows 7 tls1.2 failed

Time:09-16

 
HOpen=WinHttpOpen (L "Aurora Console App", WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0);
if (! HOpen) {
Wprintf (L "WinHttpOpen failed (0 x %. 8 x) \ n", GetLastError ());
break;
}
HConnect=WinHttpConnect (" raw.github.com ", hOpen, L INTERNET_DEFAULT_HTTPS_PORT, 0).
if (! HConnect) {
Wprintf (L "WinHttpConnect failed (0 x %. 8 x) \ n", GetLastError ());
break;
}
LPCWSTR types [2].
Types [0]=L "text/HTML";
Types [1]=0;
//use flag WINHTTP_FLAG_SECURE to initiate the SSL
HRequest=WinHttpOpenRequest (" GET "hConnect, L, L" ZPFZZZ/test/master/README. Md ",
NULL, WINHTTP_NO_REFERER, & amp; Types [0], WINHTTP_FLAG_SECURE);
if (! HRequest)
{
Wprintf (L "WinHttpOpenRequest failed (0 x %. 8 x) \ n", GetLastError ());
break;
}

DWORD dwData=https://bbs.csdn.net/topics/0;
DWORD dwSize=sizeof (dwData);
if (! WinHttpQueryOption (hRequest, WINHTTP_OPTION_SECURE_PROTOCOLS, & amp; DwData, & amp; DwSize))
{
DWORD err=GetLastError ();
Int I=0;
}



Now in WinHttpQueryOption query WINHTTP_OPTION_SECURE_PROTOCOLS err the return value is 87, but the parameter is not fill in the wrong!
  • Related