Highlighted
Absent Member.
Absent Member.
1173 views

[archive] WinInet

[Migrated content. Thread originally posted on 22 October 2010]

Hi 🙂

I'm trying to make a connection to an https web page. C$SOCKET is not able to handle https connection (properly because of the encryption).

Therfor I'm using - or trying anyway - WinInet.dll which should be able to give me the desired possibilities to handle https communication on port 443.

But I have a problem with the call to InternetOpenA. It gives me a handle all right - allthough the handle has an odd value. But when I try to use this handle with InternetConnectA I get a NULL return code.

The following call to GetLastError gives me a return code of 6, which means Invalid Handle.

Does anyone have any experience with the WinInet.dll ? Please se the attached test program.

Any help would be much appreciated.

Regards
Steen Bjerge
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] WinInet

I don't know the InternetConnect, but I suspect the problem lies in the parameters of the function.

I would advise that you start out testing this with a non secure connection to see that work first, and then move on to use a secure connection.

Another alternative may be to use the InternetOpenUrl, attached is an example illustrating how to use that. You could compare the outcome of the calls here with what you get in your program and see if the handle values for instance differs.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] WinInet

I've tried running your sample program (thanks by the way) - and the InternetCheckConnectio call returns NULL ? I have internet connection - but could this be because I'm behind a firewall ?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] WinInet

Not sure, have you tried elsewhere?
Could you try to do:

CALL "GetLastError" GIVING dwResult

and see what value it is?
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.