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.
 
 
 
 
 
 

21 lines
553 B

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