R
Rudolpho
Guest
We are trying to communicate to a host over SSL but the problem is that CInternetSession::OpenUrl Generates exception 12057:
CInternetSession isession;
CHttpFile* pFile = NULL;
CString httpadrstr = L"https://theadress.com";
DWORD dw;
char buffer[2048];
BOOL bret = TRUE;
try
{
isession.SetOption(INTERNET_OPTION_SECURITY_FLAGS, SECURITY_FLAG_IGNORE_REVOCATION);
pFile = (CHttpFile*)isession.OpenURL(httpadrstr, 1, INTERNET_FLAG_TRANSFER_ASCII | INTERNET_FLAG_SECURE, NULL, 0);
pFile->QueryInfoStatusCode(dw);
switch (dw)
{
case 200:
pFile->Read(buffer, 2048);
break;
default:
bret = FALSE;
}
pFile->Close();
}
catch (CInternetException* pEx)
{
bret = FALSE;
pEx->Delete();
}
This code genrates the exception. If i paste the host adress in Opera or Edge it works fine. Any Idea?
Continue reading...
CInternetSession isession;
CHttpFile* pFile = NULL;
CString httpadrstr = L"https://theadress.com";
DWORD dw;
char buffer[2048];
BOOL bret = TRUE;
try
{
isession.SetOption(INTERNET_OPTION_SECURITY_FLAGS, SECURITY_FLAG_IGNORE_REVOCATION);
pFile = (CHttpFile*)isession.OpenURL(httpadrstr, 1, INTERNET_FLAG_TRANSFER_ASCII | INTERNET_FLAG_SECURE, NULL, 0);
pFile->QueryInfoStatusCode(dw);
switch (dw)
{
case 200:
pFile->Read(buffer, 2048);
break;
default:
bret = FALSE;
}
pFile->Close();
}
catch (CInternetException* pEx)
{
bret = FALSE;
pEx->Delete();
}
This code genrates the exception. If i paste the host adress in Opera or Edge it works fine. Any Idea?
Continue reading...