You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
559 B

require 'simpleidn'
require 'cryptcheck'
class SSHWorker
include Sidekiq::Worker
sidekiq_options retry: false
def perform(host, port)
idn = SimpleIDN.to_ascii host
result = begin
server = idn, port
kex: server.kex,
encryption: server.encryption,
hmac: server.hmac,
compression: server.compression,
key: server.key
rescue CryptCheck::Ssh::Server::SshNotAvailableException
{ no_ssh: true }
end :ssh, "#{host}:#{port}", result