Sha256: c8fc757044f89d5af8d1ad65dd0abd31a8cabc973625512e97ee8e64c63cc808

Contents?: true

Size: 798 Bytes

Versions: 118

Compression:

Stored size: 798 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 'pg'
$stderr.puts "connecting to postgres://#{PGHOST}/#{PGDB}"
conn = PG.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

118 entries across 118 versions & 4 rubygems

Version Path
pg-1.5.9-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.9-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.9-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.5.9 misc/openssl-pg-segfault.rb
pg-1.5.8-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.8-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.5.8-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.8 misc/openssl-pg-segfault.rb
pg-1.5.7-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.7-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.7-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.5.7 misc/openssl-pg-segfault.rb
pg-1.5.6-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.5.6-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.6-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.6 misc/openssl-pg-segfault.rb
pg-1.5.5-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.5-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.5.5-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.5.5 misc/openssl-pg-segfault.rb