Skip to content

Commit

Permalink
fix(cloudevents-server): fix tls verify (#33)
Browse files Browse the repository at this point in the history
avoid it with disabling

Signed-off-by: wuhuizuo <wuhuizuo@126.com>

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo authored Dec 8, 2023
1 parent e652158 commit bcd76b2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cloudevents-server/pkg/events/custom/tekton/lark.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package tekton

import (
"crypto/tls"
"fmt"
"net/http"
"strings"

cloudevents "github.com/cloudevents/sdk-go/v2"
Expand All @@ -14,7 +16,17 @@ import (
)

func newLarkClient(cfg config.Lark) *lark.Client {
return lark.NewClient(cfg.AppID, cfg.AppSecret, lark.WithLogReqAtDebug(true), lark.WithEnableTokenCache(true))
// Disable certificate verification
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
httpClient := &http.Client{Transport: tr}

return lark.NewClient(cfg.AppID, cfg.AppSecret,
lark.WithLogReqAtDebug(true),
lark.WithEnableTokenCache(true),
lark.WithHttpClient(httpClient),
)
}

func newLarkMessage(receiveEmail string, event cloudevents.Event, detailBaseUrl string) (*larkim.CreateMessageReq, error) {
Expand Down

0 comments on commit bcd76b2

Please sign in to comment.