Hi all,
Does anyone know how to prevent calls to InternetOpenUrl() from failing with error 12045 (ERROR_INTERNET_INVALID_CA)? I have the following code below:
Code:
HINTERNET IntOpen = ::InternetOpen(L"Sample", LOCAL_INTERNET_ACCESS, NULL, 0, 0);
HINTERNET handle = ::InternetOpenUrl(IntOpen, L"https://192.168.1.10/file.txt", NULL, NULL, INTERNET_FLAG_IGNORE_CERT_CN_INVALID, NULL);
if (handle == NULL) {
cout << "Error opening URL, " << GetLastError();
return 1;
}
char buf[1024];
DWORD dwRead = 0;
while (InternetReadFile(handle, buf, sizeof(buf), &dwRead) == TRUE) {
if (dwRead == 0)
break;
cout << buf;
}
This works OK on valid sites, but since my server has a self signed certificate, it fails with error code 12045. I know the INTERNET_FLAG_IGNORE_CERT_CN_INVALID is technically looking for hostname mismatches, and not invalid CA's.
Any help would be appreicated.
Thanks,
Suggestions for Functional module
Hello experts,
Cron Job and Output
I have php codes running under a cron job.But everytime i output (echo) , it comes out as complete text:THe php script is setup to output some stuff so they are sent to the cron email...but all the
[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.If the program exits normally the port closes fine, however, if it crashes sometimes it remains open and I am unable to close it. The next time
scandir clients directory
hi,how can i scandir the clients directory? i need a script that when i click a button it will upload all the files in the directory$dir =
PHP mail() with images
I'm trying to get images to send along with my HTML e-mail sent through PHP mail(). I only tried viewing the e-mail through google mail and thunderbird, google mail showed the image but thunderbird
limit string by words??
hello all,I was wonder if there is a function to limit a string by the number of words instead of characters?
import table with dependency
Hi
Making multiple rows with one query
I have a table called efed_handler_characters with two fields handler_id and bio_id. What query 2 is supposed to do is get the id from the handler and then with each char(acter) is supposed to make a
Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out where the best place to start would be.Website PagesBackstage 2 provides website pages for the
How to get exact 3 moths post date from today date using javascript
How to get exact 3 moths post date from today date using javascriptPlease help