open-uri and HTTPS, or net/https with a redirect

Discussion in 'Ruby' started by jotto, Oct 2, 2006.

  1. jotto

    jotto Guest

    jotto, Oct 2, 2006
    #1
    1. Advertising

  2. jotto

    snacktime Guest

    On 10/1/06, jotto <> wrote:
    > Is there anything wrong with using this patch?
    >
    > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/4365
    >


    Do you need it? That only provides the ability to check the validity
    of a server certificate. You don't need that just to connect via ssl.

    > How do you implement it?
    >
    > If not a good solution, can net/http be used with HTTPS sites and can
    > redirection be built in?
    >


    Not sure what you mean by redirection. Here is an example of an ssl POST.

    require 'net/https'

    https = Net::HTTP.new(host,port)
    https.use_ssl = true
    headers = { 'Referer' => '', 'Content-Type' =>
    'application/x-www-form-urlencoded' }
    response = https.post(path, request, headers)
    p response.body
     
    snacktime, Oct 2, 2006
    #2
    1. Advertising

  3. jotto

    jotto Guest

    i am trying to connect to https://login.yahoo.com which redirects to
    what is im assuming a load balanced server.


    snacktime wrote:
    > On 10/1/06, jotto <> wrote:
    > > Is there anything wrong with using this patch?
    > >
    > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/4365
    > >

    >
    > Do you need it? That only provides the ability to check the validity
    > of a server certificate. You don't need that just to connect via ssl.
    >
    > > How do you implement it?
    > >
    > > If not a good solution, can net/http be used with HTTPS sites and can
    > > redirection be built in?
    > >

    >
    > Not sure what you mean by redirection. Here is an example of an ssl POST.
    >
    > require 'net/https'
    >
    > https = Net::HTTP.new(host,port)
    > https.use_ssl = true
    > headers = { 'Referer' => '', 'Content-Type' =>
    > 'application/x-www-form-urlencoded' }
    > response = https.post(path, request, headers)
    > p response.body
     
    jotto, Oct 2, 2006
    #3
  4. jotto

    snacktime Guest

    On 10/2/06, jotto <> wrote:
    > i am trying to connect to https://login.yahoo.com which redirects to
    > what is im assuming a load balanced server.


    You mean after you login? It doesn't redirect me anywhere when I go there.
     
    snacktime, Oct 2, 2006
    #4
  5. jotto

    jotto Guest

    correct, after you login. the login credentials can be embedded into
    the URL so that is what im doing.

    login.yahoo.com/login?login=usernamehere%40yahoo.com&passwd=passwordgoeshere


    snacktime wrote:
    > On 10/2/06, jotto <> wrote:
    > > i am trying to connect to https://login.yahoo.com which redirects to
    > > what is im assuming a load balanced server.

    >
    > You mean after you login? It doesn't redirect me anywhere when I go there.
     
    jotto, Oct 2, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stanimir Stamenkov
    Replies:
    1
    Views:
    2,492
    Stanimir Stamenkov
    Aug 17, 2005
  2. Randy Lawrence

    open-uri: problem handling https?

    Randy Lawrence, Jul 8, 2004, in forum: Ruby
    Replies:
    4
    Views:
    91
    Carl Youngblood
    Jul 10, 2004
  3. Jay 99
    Replies:
    2
    Views:
    201
    Jay 99
    Apr 4, 2009
  4. Xavier Del Castillo
    Replies:
    1
    Views:
    320
    Tanaka Akira
    Feb 28, 2011
  5. Turbo
    Replies:
    2
    Views:
    167
    Turbo
    Nov 1, 2006
Loading...

Share This Page