fails to connect to gtalk (TLS)

Discussion in 'Ruby' started by darren, Jun 4, 2008.

  1. darren

    darren Guest

    Platform : Debian GNU/Linux Unstable
    Ruby version: ruby 1.8.7 (2008-05-31 patchlevel 0) [i486-linux]

    here is the sample code:
    ----------------
    require 'openssl'
    require 'socket'

    socket = TCPSocket.new("talk.google.com", 5223)
    ctx = OpenSSL::SSL::SSLContext.new('TLSv1')

    sslsocket = OpenSSL::SSL::SSLSocket.new(socket, ctx)

    begin
    puts "Start connect"
    sslsocket.connect
    rescue OpenSSL::SSL::SSLError => ssle
    puts "------------------#{ssle.message}---------------"
    end

    puts "finished"
    -----------------
    it fails to connect with message:

    SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A

    while the sample code runs pretty ok on windows with ruby stable
    version.
     
    darren, Jun 4, 2008
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.