def scan
    scan_result = Rex::SSLScan::Result.new
    scan_result.openssl_sslv2 = sslv2
    # If we can't get any SSL connection, then don't bother testing
    # individual ciphers.
    if test_ssl == :rejected and test_tls == :rejected
      return scan_result
    end

    threads = []
    ciphers = Queue.new
    @supported_versions.each do |ssl_version|
      sslctx = OpenSSL::SSL::SSLContext.new(ssl_version)
      sslctx.ciphers.each do |cipher_name, ssl_ver, key_length, alg_length|
        threads << Thread.new do
          begin
            status = test_cipher(ssl_version, cipher_name)
            ciphers << [ssl_version, cipher_name, key_length, status]
            if status == :accepted and scan_result.cert.nil?
              scan_result.cert = get_cert(ssl_version, cipher_name)
            end
          rescue Rex::SSLScan::Scanner::InvalidCipher
            next
          end
        end
      end
    end
    threads.each { |thr| thr.join }

    until ciphers.empty? do
      cipher = ciphers.pop
      scan_result.add_cipher(*cipher)
    end
    scan_result
  end
def scan
    scan_result = Rex::SSLScan::Result.new
    scan_result.openssl_sslv2 = sslv2
    # If we can't get any SSL connection, then don't bother testing
    # individual ciphers.
    if test_ssl == :rejected and test_tls == :rejected
      return scan_result
    end

    threads = []
    ciphers = Queue.new
    @supported_versions.each do |ssl_version|
      sslctx = OpenSSL::SSL::SSLContext.new(ssl_version)
      sslctx.ciphers.each do |cipher_name, ssl_ver, key_length, alg_length|
        threads << Thread.new do
          begin
            status = test_cipher(ssl_version, cipher_name)
            ciphers << [ssl_version, cipher_name, key_length, status]
            if status == :accepted and scan_result.cert.nil?
              scan_result.cert = get_cert(ssl_version, cipher_name)
            end
          rescue Rex::SSLScan::Scanner::InvalidCipher
            next
          end
        end
      end
    end
    threads.each { |thr| thr.join }

    until ciphers.empty? do
      cipher = ciphers.pop
      scan_result.add_cipher(*cipher)
    end
    scan_result
  end
Initiate the Scan against the target. Will test each cipher one at a time.
 @return [Result] object containing the details of the scan