Skip to content

Socket_mode internals uses its own SSL context and not the one provided by the client #1175

@charlch

Description

@charlch

SocketModeHandler doesn't seem to use the ssl_context provided to it by the client passed to it.
I think it should use the context provided if available and fall back to the default context if not.

I'm work on a fix here: charlch@afd7cf0

Reproducible in:

pip freeze | grep slack
python --version
sw_vers && uname -v # or `ver`

The Slack SDK version

slack-sdk==3.14.1

Python runtime version

Python 3.6.5 |Man Group Plc| (default, Jul  4 2019, 14:15:57) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

OS info

LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.5.1804 (Core) 
Release:	7.5.1804

Expected result:

I expect to be able to provide an SSL context for the websockets to use.
I can provide one to the WebClient:

WebClient(token=BOT_TOKEN, ssl=ssl_context)

and I want to use the same context for the websocket.

Actual result:

When the SocketModeHandler constructs a Connection it uses ssl.create_default_context() for the context:
image
and not the one I provide.

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Metadata

Metadata

Assignees

Labels

Version: 3xbugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedsocket-mode

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions