Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket: bad handshake at socketmode #1360

Open
vincentlau0493 opened this issue Dec 13, 2024 · 0 comments
Open

Websocket: bad handshake at socketmode #1360

vincentlau0493 opened this issue Dec 13, 2024 · 0 comments

Comments

@vincentlau0493
Copy link

vincentlau0493 commented Dec 13, 2024

What happened

I tried to skip TLS verification when using slack socketmode, but I got websocket bad handshake issue, here is my code:

tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
httpClient := &http.Client{Transport: tr}
client := slackgo.New(
slackCfg.BotToken, slackgo.OptionAppLevelToken(slackCfg.AppToken), slackgo.OptionHTTPClient(httpClient), slackgo.OptionDebug(true))
dialer := websocket.DefaultDialer
dialer.TLSClientConfig = &tls.Config{
InsecureSkipVerify: true,
}
socketModeClient = socketmode.New(client, socketmode.OptionDebug(true), socketmode.OptionDialer(dialer))

Here is log:

slack-go/slack2024/12/13 02:46:39 socket_mode.go:30: Using URL: wss://wss-primary.slack.com/link/?ticket=xxx&app_id=xxx
slack-go/slack/socketmode2024/12/13 02:46:39 socket_mode_managed_conn.go:301: Dialing to websocket on url wss://wss-primary.slack.com/link/?ticket=xxx&app_id=xxx
slack-go/slack/socketmode2024/12/13 02:46:43 socket_mode_managed_conn.go:311: Failed to dial to the websocket: websocket: bad handshake
slack-go/slack/socketmode2024/12/13 02:46:43 socket_mode_managed_conn.go:270: reconnection 10 failed: websocket: bad handshake reconnecting in 51.2s

Expected behavior

Steps to reproduce

reproducible code

manifest.yaml

Versions

  • Go: 1.23
  • slack-go/slack: v0.13.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant