GithubHelp home page GithubHelp logo

如何处理选择证书弹窗? about rod HOT 5 CLOSED

zobx avatar zobx commented on July 19, 2024
如何处理选择证书弹窗?

from rod.

Comments (5)

zobx avatar zobx commented on July 19, 2024

或者怎么默认加载.pfx的证书文件,默认选择确认

from rod.

ysmood avatar ysmood commented on July 19, 2024

这应该是一个 upstream 问题,chromium 不支持这个 api,你可以看看 puppeteer 的一些解决方案,rod 同样适用:

puppeteer/puppeteer#540

from rod.

kvii avatar kvii commented on July 19, 2024

#367 应该是一个问题。
可不可以直接在 rod 启动时将证书导入到 rod 中,除了 hijack 外有其他方案吗?


It looks like as same as #367.
Can we add certication file (eg: .pfx, .crt) to rod at start. Is there has some solution rather than hijack?

from rod.

ysmood avatar ysmood commented on July 19, 2024

可能有 cli 启动 flag 可以这么干,可能需要开发者自己去查下。

from rod.

kvii avatar kvii commented on July 19, 2024

没找到 go 或者 chrome 能导入证书的 api。而且在这个情况中也不能给什么 ignore 或 insecure 之类的 flag。

最后还是用 hijack 解决了问题,关键部分伪代码如下:

client := &http.Client{
	Transport: &http.Transport{
		TLSClientConfig: ...,
	},
}
...

hr := browser.HijackRequests()
hr.Add("*", "", func(h *rod.Hijack) {
	err := h.LoadResponse(client, true)
	if err != nil {
		h.ContinueRequest(&proto.FetchContinueRequest{})
	}
})
go hr.Run()
...

from rod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.