You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am integrating slack with an application. while running code with 'go test', everything is working fine, but once i deploy the app in docker container after generating a build, it is throwing the following error:
Hi @isidhux , please make sure that your docker container has the latest ca-certificates installed (especially if using scratch). If this recently started happening it may be related to the Let's Encrypt Certificate Chain change.
What happened
I am integrating slack with an application. while running code with 'go test', everything is working fine, but once i deploy the app in docker container after generating a build, it is throwing the following error:
"Post "https://slack.com/api/chat.postMessage\": tls: failed to verify certificate: x509: certificate signed by unknown authority"
Expected behavior
It should send the messages
Steps to reproduce
generate a build and run the binary in ubuntu:latest docker container
i am using docker compose to run the app and redis container
use the code from slack-go tutorial https://medium.com/@wambuirebeka/how-to-integrate-slack-notifications-using-golang-84451aca27e3#:~:text=New()%20New%20builds%20a,the%20provided%20token%20and%20options.&text=Our%20func%20sendSlackMessage%20takes%20in,a%20message%20to%20a%20channel.
reproducible code
type Slack struct {
SlackClient *slack.Client
ChannelID string
}
func (s *Slack) SendSlackMessage(message string) error {
ChannelID, timestamp, err := s.SlackClient.PostMessage(s.ChannelID, slack.MsgOptionText(message, false))
if err != nil {
return err
}
fmt.Printf("Message sent successfully to %s channel at %s\n", ChannelID, timestamp)
return nil
}
slackObj := &Slack{
SlackClient: slack.New("token-string"),
ChannelID: "channel-id",
}
if err := slackObj.SendSlackMessage("Vcenter Sync Failed"); err != nil {
t.Fatalf("Error occured while sending slack msg: %v \n", err)
}
Versions
The text was updated successfully, but these errors were encountered: