import ssl


def create_ssl_context(verify=True, cafile=None, capath=None):
    """Set up the SSL context.
    """
    context = ssl.create_default_context(cafile=cafile, capath=capath)
    if not verify:
        context.check_hostname = False
        context.verify_mode = ssl.CERT_NONE
    return context