Amitava Shee's Technical Diary

Sunday, September 03, 2006

HTTPS not suppored by open-uri module in Ruby

The open-uri module provides a convenient overload to Kernel::open that allows uniform and easy access to different IO resource type. However this does not work with SSL (https) sites. See the irb session below

irb(main):001:0> require 'open-uri'
=> true
irb(main):002:0> url = "https://www.salliemae.com/"
=> "https://www.salliemae.com/"
irb(main):003:0> open(url) { |f| p f.read }
OpenSSL::SSL::SSLError: certificate verify failed
from c:/ruby/lib/ruby/1.8/net/http.rb:586:in `connect'
from c:/ruby/lib/ruby/1.8/net/http.rb:586:in `connect'
from c:/ruby/lib/ruby/1.8/net/http.rb:553:in `do_start'
from c:/ruby/lib/ruby/1.8/net/http.rb:542:in `start'
from c:/ruby/lib/ruby/1.8/open-uri.rb:245:in `open_http'
from c:/ruby/lib/ruby/1.8/open-uri.rb:629:in `buffer_open'
from c:/ruby/lib/ruby/1.8/open-uri.rb:167:in `open_loop'
from c:/ruby/lib/ruby/1.8/open-uri.rb:165:in `open_loop'
from c:/ruby/lib/ruby/1.8/open-uri.rb:135:in `open_uri'
from c:/ruby/lib/ruby/1.8/open-uri.rb:531:in `open'
from c:/ruby/lib/ruby/1.8/open-uri.rb:86:in `open'
from (irb):3
irb(main):004:0>

How to run .NET 2.0 SDK help outside visual studio 2005

Visual Studio 2005 does not distribute help in chm format. It took some spelunking to find out how to run MSDN help outside Visual Studio.

From Start->Run, invoke the following

dexplore /helpcol ms-help://MS.NETFramework.v20.en

However, if you try to create a shortcut, you have to specify the full path as
"C:\Program Files\Common Files\Microsoft Shared\Help\dexplore.exe" /helpcol ms-help://MS.NETFramework.v20.en

Please note that you can create an alias to an executable by creating a .reg file as below

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Your Alias]
"Path"="path containing exe with a trailing backslash"
@="full path exe"