import urllib3
import certifi
import yaml


def get_config(link):
    """get config from subscription link

    @param link: subscription link of clash
    @type  link: String

    @return: clash config
    @rtype : Dict
    """
    http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED',
                               ca_certs=certifi.where())
    response = http.request('GET', link)
    config = yaml.safe_load(response.data.decode('utf-8'))
    return config