Skip to content

[FEATURE] Allow overriding of CA certificates #2557

@NiklasRosenstein

Description

@NiklasRosenstein

Running a Telegram bot behind a proxy server that inspects traffic results in an SSL certificate error. Setting REQUESTS_CA_BUNDLE or SSL_CERT_FILE does not work because python-telegram-bot uses certifi which respects neither of the environment variables.

kwargs = dict(
maxsize=con_pool_size,
cert_reqs='CERT_REQUIRED',
ca_certs=certifi.where(),
socket_options=sockopts,
timeout=urllib3.Timeout(connect=self._connect_timeout, read=read_timeout, total=None),
)

My feature request is that a parameter "use system certificates" or an argument for the certificates file path on the Updater (and probably on Bot as well because that class actually instantiates the Request class) gets added.

It could also be an argument on the Request class that we can set by passing the request_kwargs to the Updater or a Request object directly to the Bot.

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