def version_check
if RUBY_VERSION < "1.8.2"
unless OpenSSL::PKey::DH.instance_methods.include? "p"
warn "Your OpenSSL module (the Ruby module, not the library)\n" +
"is too old. Please go to the Net::SSH downloads page\n" +
"and install the most recent snapshot of the OpenSSL\n" +
"module.\n\n" +
" http://rubyforge.org/projects/net-ssh"
abort
end
end
match = OpenSSL::OPENSSL_VERSION.match(
/OpenSSL (\d+)\.(\d+)\.(\d+)(.*?) / )
major = match[1].to_i
minor = match[2].to_i
tiny = match[3].to_i
patch = match[4]
if major < 1 && ( minor < 9 || minor == 9 && tiny < 7 )
ver = "#{major}.#{minor}.#{tiny}#{patch}"
warn "Your OpenSSL library (the library itself, not the Ruby\n" +
"module) is version #{ver}, too old to use with Net::SSH.\n" +
"Please upgrade to at least version 0.9.7 and then rebuild\n" +
"your Ruby OpenSSL module."
abort
end
end