views:

43

answers:

2

in Visual Basic 6

How can i check that communication to port 443 is opened for network requests?

I must NOT use any 3rd party controls / activeX / OCX, so I'm looking for ways to send / receive an https or just make a connection to a server which is serving on 443, using windows (2k/2k3/xp/7/vista) API calls.

There is a known server I can check against. (or, for that matter, https://google.com/accounts)

Thanks.

A: 

I've done similar for ping in the past, perhaps you can modify it to use telnet to post a http get on 443. This code calls the ping command and directs the output to a file

Set objShell = CreateObject("WScript.Shell")
Call objShell.run("%comspec% /c ping 127.0.0.1 > c:\ping.log", 0, False)
'code to read results from ping.log here

You may also want to look at the winsock control. It may already be installed on the client computers.

bugtussle
thanks, but i prefer not to rely at all on local resources. also, what ping has to do with specific arbitrary ports? telnet maybe. still, it's external, and i can't take any risks with this prog.
Berry Tsakala
+2  A: 

There are a couple of ways that I can think of. One being to use WinInet, specifically the InternetOpenUrl function. Another way is to use WinHttp. You can use the function WinHttpOpenRequest. You can also use it as a COM object. Here are a few examples:

http://www.ex-designz.net/apidetail.asp?api_id=72

http://msdn.microsoft.com/en-us/library/Aa384072

Garett