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
521 B
21 lines
521 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.analyze host, port
|
|
{
|
|
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
|
|
|