<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Johan Känngård &#187; Visual Basic</title>
	<atom:link href="http://johankanngard.net/category/programming/visual-basic/feed/" rel="self" type="application/rss+xml" />
	<link>http://johankanngard.net</link>
	<description>Useful tips for developers</description>
	<lastBuildDate>Thu, 19 May 2011 18:40:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WinHTTPRequest COM object options constants</title>
		<link>http://johankanngard.net/2005/11/11/winhttprequest-com-object-options-constants/</link>
		<comments>http://johankanngard.net/2005/11/11/winhttprequest-com-object-options-constants/#comments</comments>
		<pubDate>Fri, 11 Nov 2005 11:45:26 +0000</pubDate>
		<dc:creator>Johan Känngård</dc:creator>
				<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://johankanngard.net/?p=20</guid>
		<description><![CDATA[I have tried to search for the literal values of some of the options to <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/winhttp.asp">WinHTTP</a> that handles SSL server certificates errors. In my case I have a development server that has a certificate with the wrong name in it, and I want to ignore the usual "The host name in the certificate is invalid or does not match" error. At last, I find the values to use!]]></description>
			<content:encoded><![CDATA[<p>I have tried to search for the literal values of some of the options to <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/winhttp.asp">WinHTTP</a> that handles SSL server certificates errors. In my case I have a development server that has a certificate with the wrong name in it, and I want to ignore the usual &#8220;The host name in the certificate is invalid or does not match&#8221; error. Since I am using LotusScript to access the COM class <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/using_the_winhttprequest_com_object.asp">WinHTTP.WinHTTPRequest</a>, I can&#8217;t simply use:<br />
<code><br />
Dim http As Variant<br />
Set http = CreateObject("WinHTTP.WinHTTPRequest.5.1")<br />
http.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = 13056<br />
</code><br />
This of course generates an error, since the WinHttpRequestOption_SslErrorIgnoreFlags constant can not be found in LotusScript.<br />
The answer couldn&#8217;t be found anywhere on MSDN, but some searching on Google led me to <a href="http://www.fastbugtrack.com/support/misc/default.asp">a page</a> at <a href="http://www.fastbugtrack.com/">fastbugtrack.com</a> with some code that contains the constant I needed! So here they are for future reference:<br />
<code><br />
' WinHTTPRequest options:<br />
Const WinHttpRequestOption_UserAgentString = 0<br />
Const WinHttpRequestOption_URL = 1<br />
Const WinHttpRequestOption_URLCodePage = 2<br />
Const WinHttpRequestOption_EscapePercentInURL = 3<br />
Const WinHttpRequestOption_SslErrorIgnoreFlags = 4<br />
Const WinHttpRequestOption_SelectCertificate = 5<br />
Const WinHttpRequestOption_EnableRedirects = 6<br />
Const WinHttpRequestOption_UrlEscapeDisable = 7<br />
Const WinHttpRequestOption_UrlEscapeDisableQuery = 8<br />
Const WinHttpRequestOption_SecureProtocols = 9<br />
Const WinHttpRequestOption_EnableTracing = 10<br />
</code><br />
The actual value for http.Option(WinHttpRequestOption_SslErrorIgnoreFlags) that I have set to 13056 (hexadecimal 0&#215;3300) is an addition of all switches found at the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winhttp/http/winhttprequestoption.asp">WinHttpRequestOption</a> documentation at WinHttpRequestOption_SslErrorIgnoreFlags.</p>
]]></content:encoded>
			<wfw:commentRss>http://johankanngard.net/2005/11/11/winhttprequest-com-object-options-constants/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

