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.4.4 misc/openssl-pg-segfault.rb
pg-1.4.3-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.4.3-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.4.3-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.4.3 misc/openssl-pg-segfault.rb
pg-1.4.2-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.4.2-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.4.2-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.4.2 misc/openssl-pg-segfault.rb
pg-1.4.1-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.4.1-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.4.1-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.4.1 misc/openssl-pg-segfault.rb
pg-1.4.0-x86-mingw32 misc/openssl-pg-segfault.rb
pg-1.4.0-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.4.0-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.4.0 misc/openssl-pg-segfault.rb
pg-1.3.5-x64-mingw-ucrt misc/openssl-pg-segfault.rb
pg-1.3.5-x64-mingw32 misc/openssl-pg-segfault.rb
pg-1.3.5-x86-mingw32 misc/openssl-pg-segfault.rb