Problem using https://

D

Dave Thomas

For the first time I'm trying to connect to an https server. However,
when I try

require 'net/https'
site = Net::HTTP.new(HOST, PORT)
site.use_ssl = true
http_resp, = site.get2(SCRIPT + arg,
'Authorization' => 'Basic ' +
["xxxx:yyyy"].pack('m').strip )

I get:

warning: peer certificate won't be verified in this SSL session.
/usr/lib/ruby/1.9/net/protocols.rb:49:in `connect': unknown protocol
(OpenSSL::SSL::SSLError)
from /usr/lib/ruby/1.9/net/protocols.rb:49:in `ssl_connect'
from /usr/lib/ruby/1.9/net/https.rb:181:in `on_connect'
from /usr/lib/ruby/1.9/net/http.rb:433:in `do_start'
from /usr/lib/ruby/1.9/net/http.rb:419:in `start'
from /usr/lib/ruby/1.9/net/http.rb:824:in `request'
from /usr/lib/ruby/1.9/net/http.rb:734:in `get2'


(This is 1.9 CVS head under OSX)

Is there a magic incantation I'm missing?


Cheers

Dave
 
G

Gregory Millam

Received: Tue, 13 Jan 2004 05:03:07 +0900
And said:
require 'net/https'
site = Net::HTTP.new(HOST, PORT)
site.use_ssl = true
http_resp, = site.get2(SCRIPT + arg,
'Authorization' => 'Basic ' +
["xxxx:yyyy"].pack('m').strip )

is PORT set to the correct https port? (443)
 
D

Dave Thomas

Received: Tue, 13 Jan 2004 05:03:07 +0900
And said:
require 'net/https'
site = Net::HTTP.new(HOST, PORT)
site.use_ssl = true
http_resp, = site.get2(SCRIPT + arg,
'Authorization' => 'Basic ' +
["xxxx:yyyy"].pack('m').strip )

is PORT set to the correct https port? (443)


D'oh...

Cheers

Dave
 
J

jason r tibbetts

Quoting Dave Thomas said:
Received: Tue, 13 Jan 2004 05:03:07 +0900
And said:
require 'net/https'
site = Net::HTTP.new(HOST, PORT)
site.use_ssl = true
http_resp, = site.get2(SCRIPT + arg,
'Authorization' => 'Basic ' +
["xxxx:yyyy"].pack('m').strip )

is PORT set to the correct https port? (443)

Don't worry, Dave--it sounds like a design defect that's pretty easy to forget.
Anyone know why the HTTPS class doesn't provide its own new() with 443 as the
default value of 'port'?

--
jason

:wq
___________________________________________________________
This mail sent using ToadMail -- Web based e-mail @ ToadNet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top