亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在gocloak中跳過(X509)證書驗證?

如何在gocloak中跳過(X509)證書驗證?

Go
波斯汪 2023-08-21 14:43:37
我正在嘗試使用gocloak從 keycloak 驗證我的令牌,并為此使用以下代碼。token:=""client:= gocloak.NewClient("https://example.com")_, err := client.RetrospectToken(token,"client-id" ,"client-secret", "realm")log.Print(err.Error())我遇到以下錯誤,Post https://example.com/auth/realms/realm/protocol/openid-connect/token/introspect: x509: certificate signed by unknown authority有什么辦法可以跳過 gocloak 中的證書驗證嗎?
查看完整描述

1 回答

?
米琪卡哇伊

TA貢獻1998條經驗 獲得超6個贊

因此,您正在尋找跳過 TLS 中的證書驗證的方法,請嘗試使用RestyClient


token:=""

client := gocloak.NewClient(serverURL)

restyClient := client.RestyClient()

restyClient.SetDebug(true)

restyClient.SetTLSClientConfig(&tls.Config{ InsecureSkipVerify: true })

_, err := client.RetrospectToken(token,"client-id" ,"client-secret", "realm")

log.Print(err.Error())


查看完整回答
反對 回復 2023-08-21
  • 1 回答
  • 0 關注
  • 109 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號