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

请问这样如何?能否支持获取proxy使用的根证书。 #37

Open
wangborong12345 opened this issue Jan 11, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@wangborong12345
Copy link
Contributor

请问这样如何?能否支持获取proxy使用的根证书。

func (proxy *Proxy) GetCertificate() x509.Certificate {
	return proxy.interceptor.ca.RootCert
}

类似这样,因为我想在创建proxy之后,使用系统api加载证书到证书列表里,用户只需要允许操作即可。

			p, err := proxy.NewProxy(opts)
			if err != nil {
				log.Fatal(err)
			}
			p.AddAddon(&modifyResponse)

			// 检查系统是否导入代理ca证书
			existCa, err := loadSystemRoots()
			if err != nil {
				log.Fatal(err)
			}
			if !existCa {
				addCertificate(p.GetCertificate()) // 这里
			}

如果不支持,就是书写类似cert.load函数,加载一次。

@lqqyt2423
Copy link
Owner

你的意思是添加GetCertificate这个方法吗,你可以提交pr过来

这个功能:在创建proxy之后,使用系统api加载证书到证书列表里,用户只需要允许操作即可,你可以添加一个启动参数例如是否自动信任证书,然后添加功能,我也可以接受pr

@wangborong12345
Copy link
Contributor Author

好的,谢谢回复。

@lqqyt2423 lqqyt2423 added the enhancement New feature or request label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants