InternetOpenUrl() Invalid cert


Posted on 16th Feb 2014 07:03 pm by admin

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:

Did you know?Explore Trending and Topic pages for more stories like this.
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,
No comments posted yet

Your Answer:

Login to answer
270 Like 36 Dislike
Previous forums Next forums
Other forums

PHP Redirecting
Hello everyone. Is there a way to redirect people to pages within a statement in PHP? Since there is

login page does not execute a else statement
I've created a login page using sessions.
When an incorrect user name or password is entered then

DELETE rows based on content
I have a link in my rows

$bit="http://bit.ly/abcd";
$query = mysql_query("D

[newb] Image hosting help.
Hey there, I'm new to php, I know some basics and i can code PWN, I'm only 14 but I'm interested in

Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does

newbie question about multiple queries
hi everyone,
I'm sorry to ask such a basic question, but I'm young and trying to learn php on my

Problem with the Update command used with a sqldataadapter
I'm connected to a database on an SQL Server and I'm using a sqldataadapter, sqlconnection, sqldatas

query help
Hi experts.

i have a table rep2 like this
PROD_COD ACCT_NO DUE_DAYS BALANCE

getting weird error..
okay, I'm getting an error on this particular function, something about the syntax in the mysql LIMI

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash