Sha256: ee958f1d834ea8187dba0e700b4d217a20fde2fbbe2c2edc3261c4ecdd91cdf8
Contents?: true
Size: 801 Bytes
Versions: 5
Compression:
Stored size: 801 Bytes
Contents
# -*- ruby -*- PGHOST = 'localhost' PGDB = 'test' #SOCKHOST = 'github.com' SOCKHOST = 'it-trac.laika.com' # Load pg first, so the libssl.so that libpq is linked against is loaded. require 'ysql' $stderr.puts "connecting to postgres://#{PGHOST}/#{PGDB}" conn = YSQL.connect(PGHOST, :dbname => PGDB ) # Now load OpenSSL, which might be linked against a different libssl. require 'socket' require 'openssl' $stderr.puts "Connecting to #{SOCKHOST}" sock = TCPSocket.open( SOCKHOST, 443 ) ctx = OpenSSL::SSL::SSLContext.new sock = OpenSSL::SSL::SSLSocket.new( sock, ctx ) sock.sync_close = true # The moment of truth... $stderr.puts "Attempting to connect..." begin sock.connect rescue Errno $stderr.puts "Got an error connecting, but no segfault." else $stderr.puts "Nope, no segfault!" end
Version data entries
5 entries across 5 versions & 1 rubygems