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.

ssh_worker.rb 546B

123456789101112131415161718192021
  1. class SSHWorker
  2. include Sidekiq::Worker
  3. sidekiq_options retry: false
  4. def perform(host, port=nil)
  5. host = SimpleIDN.to_ascii host.downcase
  6. result = begin
  7. server = CryptCheck::Ssh::Server.new *(port ? [host, port] : [host])
  8. {
  9. kex: server.kex,
  10. encryption: server.encryption,
  11. hmac: server.hmac,
  12. compression: server.compression,
  13. key: server.key
  14. }
  15. rescue CryptCheck::Ssh::Server::SshNotAvailableException
  16. { no_tls: true }
  17. end
  18. Datastore.post :ssh, host, port, result
  19. end
  20. end