def _get_ssl_kwargs(
    ssl=False,
    ssl_keyfile=None,
    ssl_certfile=None,
    ssl_cert_reqs=None,
    ssl_ca_certs=None,
    login_method=None,
):
    """
    Return SSL keyword arguments to be used with the kombu.Connection class.
    """
    ssl_kwargs = {}

    # NOTE: If "ssl" is not set to True we don't pass "ssl=False" argument to the constructor
    # because user could still specify to use SSL by including "?ssl=true" query param at the
    # end of the connection URL string
    if ssl is True:
        ssl_kwargs["ssl"] = True

    if ssl_keyfile:
        ssl_kwargs["ssl"] = True
        ssl_kwargs["keyfile"] = ssl_keyfile

    if ssl_certfile:
        ssl_kwargs["ssl"] = True
        ssl_kwargs["certfile"] = ssl_certfile

    if ssl_cert_reqs:
        if ssl_cert_reqs == "none":
            ssl_cert_reqs = ssl_lib.CERT_NONE
        elif ssl_cert_reqs == "optional":
            ssl_cert_reqs = ssl_lib.CERT_OPTIONAL
        elif ssl_cert_reqs == "required":
            ssl_cert_reqs = ssl_lib.CERT_REQUIRED
        ssl_kwargs["cert_reqs"] = ssl_cert_reqs

    if ssl_ca_certs:
        ssl_kwargs["ssl"] = True
        ssl_kwargs["ca_certs"] = ssl_ca_certs

    return ssl_kwargs

    Return SSL keyword arguments to be used with the kombu.Connection class.
    
st2common/st2common/transport/utils.py