how to access an https server with winhttp

Hi

I habe started to use winhttp to "dialogue" with web servers from a VB.Net app. It works fine as long as the server is a straightforward http server.

I now tried to do the same with an httpS server URL, and i just can't connect to it.

I have tried setting credentials like this:

URL ="https://myroot/mypage/script.do"

' Open an HTTP connection

HttpReq.Open("GET", URL,False)

' Set credentials for server.

HttpReq.SetCredentials("myuser","mypassword", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER)

' Send the HTTP Request.

HttpReq.Send()

but that does not help at all (still no response whatsoever from the server)

I have looked at the SetClientCertificate method, but I have no idea where certificates would be on my machine. The examples are hinting at the registry and HKEY_LOCAL_MACHINE, but I can't see anthing there in my registry that relates to certificates. I am working an external contarctor in a large company, and I don't know what is preventing me from accessing one of their numerous https -based pages, as I can access them interactively from the Internet Explorer without any problems. However, accessing them programatically just doesn't work, whereas it's a breeze with http servers.

Can somebody point me in the right direction ? Thanks

BalexH

[1929 byte] By [BalexH] at [2007-12-28]
# 1

BalexH,

It seems that you're using the SSL connection with https varification. Have you tried to get the certificate by the Secure Sockets Layer? I hope the following link will help you to successfully access your web service programatically:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT14.asp

BrunoYu-MSFT at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic General...