Skip to content

verify=<str> is deprecated #669

Description

@tiborrr

_config.py:51: DeprecationWarning: verify=<str> is deprecated. Use verify=ssl.create_default_context(cafile=...) or verify=ssl.create_default_context(capath=...) instead.
warnings.warn(message, DeprecationWarning)

For example in the following:

KEYCLOAK_ADMIN = KeycloakAdmin(
    server_url=KEYCLOAK_URL,
    username=KEYCLOAK_USER_ADMIN_USERNAME,
    password=KEYCLOAK_USER_ADMIN_PASSWORD,
    realm_name=KEYCLOAK_REALM,
    client_id=KEYCLOAK_CLIENT_ID,
    client_secret_key=KEYCLOAK_CLIENT_SECRET,
    verify='nginx/ssl/cert.pem',
)

I think we should think of a new method for httpx as the ssl method does not work anymore how it's currently designed.

This warning gets raised by

self.async_s = httpx.AsyncClient(verify=verify, mounts=proxies, cert=cert)

Also typing seems inconsistent here because the ConnectionManager excepts only a bool for the verify arg, while the KeycloakOpenID or KeycloakAdmin init might provide a str instead according to the typing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions