Sean M
2006-10-12 13:33:02 UTC
Hi. I'm putting together some VBScript to download the home page from a web
server. It's an HTTPS site. Due to various DMZ configurations, I'm running
this script using a URL that doesn't match the CN in the certificate.
After hunting around a bunch, I found a posting on eggheadcafe.com that gave
me the "Option(4) = 13056" parameter that I used in this script. Per the
posting, "from looking at the httprequest.idl file, you can deduce that
WinHttpRequestOption_SslErrorIgnoreFlags = 4".
I'm new to figuring out using COM objects with VBSCript. I did install the
Microsoft Platform SDK to look at the httprequest.idl file. I was quite lucky
to find this posting. To me, it did not seem obvious per the
WinHttpRequestOption documentation on MSDN that it was option 4.
So, any suggestions on how to understand how to do something like this
besides stumbling on a posting in a forum?
Here's my script:
'get_https.vbs
'To download the default page, ignoring CA errors
'13056 = 3300 hex
'3300 = 100 + 200 + 1000 + 2000
'100 = Unknown CA or untrusted root
'200 = Wrong usage
'1000 = Invalid CN
'2000 = Invalid date or certificate expired
set objWinHttpRequest=CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttpRequest.Open "GET", "https://servername.mydomain.com", False
objWinHttpRequest.Option(4) = 13056
objWinHttpRequest.Send
objWinHttpRequest.WaitForResponse()
WScript.Echo(objWinHttpRequest.ResponseText)
Here's the link from eggheadcafe:
http://www.eggheadcafe.com/ng/microsoft.public.winhttp/post560337.asp
Thanks.
-Sean
server. It's an HTTPS site. Due to various DMZ configurations, I'm running
this script using a URL that doesn't match the CN in the certificate.
After hunting around a bunch, I found a posting on eggheadcafe.com that gave
me the "Option(4) = 13056" parameter that I used in this script. Per the
posting, "from looking at the httprequest.idl file, you can deduce that
WinHttpRequestOption_SslErrorIgnoreFlags = 4".
I'm new to figuring out using COM objects with VBSCript. I did install the
Microsoft Platform SDK to look at the httprequest.idl file. I was quite lucky
to find this posting. To me, it did not seem obvious per the
WinHttpRequestOption documentation on MSDN that it was option 4.
So, any suggestions on how to understand how to do something like this
besides stumbling on a posting in a forum?
Here's my script:
'get_https.vbs
'To download the default page, ignoring CA errors
'13056 = 3300 hex
'3300 = 100 + 200 + 1000 + 2000
'100 = Unknown CA or untrusted root
'200 = Wrong usage
'1000 = Invalid CN
'2000 = Invalid date or certificate expired
set objWinHttpRequest=CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttpRequest.Open "GET", "https://servername.mydomain.com", False
objWinHttpRequest.Option(4) = 13056
objWinHttpRequest.Send
objWinHttpRequest.WaitForResponse()
WScript.Echo(objWinHttpRequest.ResponseText)
Here's the link from eggheadcafe:
http://www.eggheadcafe.com/ng/microsoft.public.winhttp/post560337.asp
Thanks.
-Sean