Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP 登录出错,请大佬们帮忙看看!!! #378

Open
jasonyunliang opened this issue Apr 5, 2023 · 4 comments
Open

LDAP 登录出错,请大佬们帮忙看看!!! #378

jasonyunliang opened this issue Apr 5, 2023 · 4 comments

Comments

@jasonyunliang
Copy link

xxxxx这里是问题描述xxxx

  1. 当前使用的版本号
    v0.2.1

  2. 是否已经升级到新版本
    是的

  3. 当前遇到的问题
    LDAP 登录出问题,已经按照

  4. 错误日志或截图

2023/04/05 10:58:01.955 [E] [value.go:447] 统一登录失败: 连接 LDAP 服务失败, err=LDAP Result Code 200 "Network Error": x509: certificate signed by unknown authority

  1. 希望增加的功能
    不知道如何解决,请帮忙

微信图片_20230405105934

@ericdai
Copy link

ericdai commented Apr 9, 2023

根证书不认识,把根证书加入信任列表
或者去掉SSL

@jasonyunliang
Copy link
Author

jasonyunliang commented Apr 9, 2023 via email

@jasonyunliang
Copy link
Author

InsecureSkipVerify: true, 开启这个可以通过。

package main

import (
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
)

func main() {
client := http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
// InsecureSkipVerify 控制client端是否验证服务器的证书链和主机名,
// 如果InsecureSkipVerify为true, crypto/tls接受服务器提供的任务和证书中的任何主机名
// 在这种模式下,tls容易收到中间机器的攻击,除非是用自定义认证,建议只用于测试或者与VerifyConnection或VerifyPeerCertificate一起使用
InsecureSkipVerify: true,
},
},
}

request, err := http.NewRequest("GET", "https://www.baidu.com", nil)
if err != nil {
	panic(err)
}
res, err := client.Do(request)
if err != nil {
	panic(err)
}

defer res.Body.Close()

reply, err := ioutil.ReadAll(res.Body)
if err != nil {
	panic(err)
}

fmt.Println("reply = ", string(reply))

}

@jason-zxsies
Copy link

改那个配置文件吗? 帮忙把要更改的配置文件路径和文件名称贴出来下。谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants