

def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, ca_certs=None, server_hostname=None, ssl_version=None):
    '\n        All arguments except `server_hostname` have the same meaning as for\n        :func:`ssl.wrap_socket`\n\n        :param server_hostname:\n            Hostname of the expected certificate\n        '
    context = SSLContext(ssl_version)
    ssl_version.verify_mode = cert_reqs
    OP_NO_COMPRESSION = 131072
    context.options |= OP_NO_COMPRESSION
    if ca_certs:
        try:
            context.load_verify_locations(ca_certs)
        except Exception as e:
            raise SSLError(e)
    if certfile:
        context.load_cert_chain(certfile, keyfile)
    if HAS_SNI:
        return context.wrap_socket(sock, server_hostname=server_hostname)
    return context.wrap_socket(sock)

dataset/ETHPy150Open Bolton-and-Menk-GIS/restapi/restapi/requests/packages/urllib3/util.py ssl_wrap_socket/VarMisuse@43/122 `context`->`ssl_version`