Skip to content

Commit

Permalink
add skip tls client get api
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Jul 23, 2024
1 parent 53af554 commit a30b79d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion service/account/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
Expand Down Expand Up @@ -459,6 +460,7 @@ func CheckPermission(c *gin.Context) {
}

c.JSON(http.StatusOK, gin.H{
"userID": req.Auth.UserID,
"message": "successfully check permission",
})
}
Expand Down Expand Up @@ -601,7 +603,11 @@ func CalibrateRegionAuth(auth *helper.Auth, kcHost string) error {
if err != nil {
return fmt.Errorf("failed to marshal auth: %v", err)
}
resp, err := http.Post(svcURL, "application/json", bytes.NewBuffer(authBody))
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &http.Client{Transport: tr}
resp, err := client.Post(svcURL, "application/json", bytes.NewBuffer(authBody))
if err != nil {
return fmt.Errorf("failed to post request: %v", err)
}
Expand Down

0 comments on commit a30b79d

Please sign in to comment.