import requests
import csv
import json


def get_cert_bl(cert_bl_url):
    """ Gets cert ioc from blacklist
    :param cert_bl_url: url for cert blacklist
    :return: list of cert IOCs in Key:Value format
    """

    cert_ioc_list = list()
    cert_ioc_request_data = requests.get(cert_bl_url, timeout=1)
    tmp_dict = csv.DictReader(cert_ioc_request_data.text.splitlines())
    for ioc in tmp_dict:
        cert_ioc_list.append(json.dumps(ioc)) 
    return cert_ioc_list