Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Go斗篷中跳过(X509)证书验证?_Go_Keycloak - Fatal编程技术网

如何在Go斗篷中跳过(X509)证书验证?

如何在Go斗篷中跳过(X509)证书验证?,go,keycloak,Go,Keycloak,我正在尝试使用下面的代码验证我的keydape令牌 token:="" client:= gocloak.NewClient("https://example.com") _, err := client.RetrospectToken(token,"client-id" ,"client-secret", "realm") log.Print(err.Error()) 我在下面的错误 Posthttps://example.com/auth/realms/realm/protocol/ope

我正在尝试使用下面的代码验证我的keydape令牌

token:=""
client:= gocloak.NewClient("https://example.com")
_, err := client.RetrospectToken(token,"client-id" ,"client-secret", "realm")
log.Print(err.Error())
我在下面的错误

Posthttps://example.com/auth/realms/realm/protocol/openid-connect/token/introspect: x509:由未知机构签署的证书


是否有任何方法可以跳过Go斗篷中的证书验证。

因此,您正在寻找TLS中证书的跳过验证,请使用
RestyClient

token:=“”
客户端:=goclope.NewClient(服务器URL)
restyClient:=client.restyClient()
restyClient.SetDebug(true)
restyClient.SetTLSClientConfig(&tls.Config{insureskipverify:true})
_,err:=client.RetrospectToken(标记,“客户端id”、“客户端机密”、“领域”)
log.Print(err.Error())

您的KeyClock有自签名证书?没有,它是从global sign签名的,但我想Go斗篷不懂global signs…让我再试一次吧!它工作起来很神奇,我知道它不利于生产,但它解决了我的问题:-)谢谢帮助