コード例 #1
0
 def setUp(self):
     self.database = sqlite_cert_db.SQLiteCertDB(
         sqlitecon.SQLiteConnectionManager(":memory:", keepalive=True))
コード例 #2
0
        list_ = requests.get(tld_list.TLD_LIST_ADDR, timeout=5)
        if list_.status_code == 200:
            create_directory(FLAGS.tld_list_dir)
            with open('/'.join((FLAGS.tld_list_dir, "tld_list")), 'w') as f:
                f.write(list_.content)
    except requests.exceptions.RequestException:
        logging.warning("Couldn't fetch top level domain list")

    sqlite_log_db = sqlite_log_db.SQLiteLogDB(
        sqlitecon.SQLiteConnectionManager(FLAGS.ct_sqlite_db))

    sqlite_temp_db_factory = sqlite_temp_db.SQLiteTempDBFactory(
        sqlitecon.SQLiteConnectionManager(FLAGS.ct_sqlite_temp_dir + "/meta"),
        FLAGS.ct_sqlite_temp_dir)

    sqlite_cert_db = sqlite_cert_db.SQLiteCertDB(
        sqlitecon.SQLiteConnectionManager(FLAGS.ct_sqlite_cert_db))

    ctlogs = client_pb2.CtLogs()
    with open(FLAGS.ctlog_config, "r") as config:
        log_config = config.read()
    text_format.Merge(log_config, ctlogs)

    ct_server_list = []
    for log in ctlogs.ctlog:
        sqlite_log_db.update_log(log)
        ct_server_list.append(log.log_server)

    prober_thread = prober.ProberThread(ctlogs, sqlite_log_db, sqlite_cert_db,
                                        sqlite_temp_db_factory,
                                        FLAGS.monitor_state_dir)
    prober_thread.start()