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.

22 lines
553 B

7 years ago
class SSHWorker
include Sidekiq::Worker
sidekiq_options retry: false
def perform(host, port=nil)
host = SimpleIDN.to_ascii host.downcase
7 years ago
result = begin
server = *(port ? [host, port] : [host])
7 years ago
kex: server.kex,
encryption: server.encryption,
hmac: server.hmac,
compression: server.compression,
key: server.key
rescue CryptCheck::Ssh::Server::SshNotAvailableException
{ no_tls: true }
7 years ago
end :ssh, "#{host}:#{port}", result