Skip to content

Commit

Permalink
fix(cloudevents/server): fix ssl verify error for internal server url (
Browse files Browse the repository at this point in the history
…#134)

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

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo authored Apr 18, 2024
1 parent 7c1c72b commit 8d08984
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cloudevents-server/pkg/events/custom/tekton/handler.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tekton

import (
"crypto/tls"
"encoding/json"
"fmt"
"io"
Expand Down Expand Up @@ -217,7 +218,14 @@ func getStepLog(baseURL, ns, podName, containerName string, tailLines int) (stri
return "", err
}

resp, err := http.Get(fmt.Sprintf("%s?container=%s&tailLines=%d", apiURL, containerName, tailLines))
// Create a custom transport with InsecureSkipVerify set to true
transport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
// Create a custom HTTP client with the custom transport
client := &http.Client{Transport: transport}

resp, err := client.Get(fmt.Sprintf("%s?container=%s&tailLines=%d", apiURL, containerName, tailLines))
if err != nil {
errLogEvent.Err(err).Send()
return "", err
Expand Down

0 comments on commit 8d08984

Please sign in to comment.