# VB WinInet



## citius21j (Apr 26, 2005)

I need to build this client which connects to a secured website, the certificates on two machines are authenticated and an input XML file is sent over in response an output XML file is received.
I am a newbie to VB and API (WinInet) and need to get this project completed ASAP.
Anyone familiar with this and time on hand please reply...Any help will be greatly appreciated


----------



## asbo (Sep 21, 2001)

So, in pseudocode, what you want to do is:

Open an SSL connection via HTTP to http://www.x.com
Wait for authentication to clear
Receive an XML file
Parse the file, and build a response
Send the response
Close the connection

Correct me where I'm wrong.
I've worked with the WinINet control before, but not securely, but I'll see what I can do.


----------



## citius21j (Apr 26, 2005)

asbo said:


> So, in pseudocode, what you want to do is:
> 
> Open an SSL connection via HTTP to http[COLOR=Blue]s[/COLOR]://www.x.com :up:
> Wait for authentication to clear :up: Verisign certificates on both client and server are authenticated
> ...


Your help will be greatly appreciated. Looking forward to your reply


----------



## asbo (Sep 21, 2001)

It almost sounds to me as though Winsock would be better suited to your purposes, as you need the server to initiate a transfer back to the client. However, if you're using a Server-Side Scripting Language, i.e. PHP or ASP, you could handle the XML as form input or likewise, and have the server send back the resulting XML all in one go.

Additionally, do you need the program itself to interface with Verisign? Honestly, I've never even thought about the concept, so I'd hope they have an SDK or something of that nature.

[edit:
Sorry if any of that was unclear .. I'm in my own little world sometimes 
/edit]


----------



## citius21j (Apr 26, 2005)

I tried using PHP Nusoap but apparently permission is denied. So we would need to use WinInet, SSPI or .Net API...
Guess Winsock is SSPI??I am not familiar with any of them..so I would greatly appreciate any help with this.
Thanks a lot


----------



## asbo (Sep 21, 2001)

If you were going to go the .NET route, then you'd have to find someone who knows it well; I never migrated up. It appears that WinInet would work just fine and that's what I'd stick with at this point in time, but SSPI looks like a .NET-based method, so I'm not so knowledgable there either.

Never heard of Nusoap either, but I'm looking into it. What do you mean by "permission is denied"?

ATM, I don't have the development IDE on this machine, otherwise I'd be playing with the available options.


----------



## citius21j (Apr 26, 2005)

Well the server doesnt support connection using Nusoap. Because nusoap is only used for http and not for https...so I get the error
"HTTP/1.1 403 Access Forbidden Server: Microsoft-IIS/5.0 Date: Thu, 28 Apr 2005 02:20:24 GMT Connection: close Content-Type: text/html Content-Length: 244 
Secure Channel Client Authentication Required
This Virtual Directory requires a browser that supports the configured encryption options."

I dont want to go the .NET route...want to use WinInet...but I dont know how to proceed.
I appreciate your help.


----------



## asbo (Sep 21, 2001)

Hmm. There HAS to be a way to get NuSOAP to run HTTPS. Have you Googled it by any chance?

However, I've got a code sample somewhere that looks as though it will make the Inet control connect to an HTTPS server and download files. But like I said, I have no IDE at the moment so I can't test it.

Also, you may or may not have to end up writing your own PHP if you're capable, but I have no idea how to do that one, I'm still a PHP newbie. There may well be commercial solutions available as well though.


----------

