Skip to main content

[archive] WinInet

  • October 22, 2010
  • 4 replies
  • 0 views

[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

4 replies

[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
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.

[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
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 ?

[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
Not sure, have you tried elsewhere?
Could you try to do:

CALL "GetLastError" GIVING dwResult

and see what value it is?

[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
Not sure, have you tried elsewhere?
Could you try to do:

CALL "GetLastError" GIVING dwResult

and see what value it is?