SSL Client Authentication with Certificate in Chrome App

删除回忆录丶 提交于 2019-12-03 20:10:00

The Chrome API does support client authentication via tcp.secure, but with a pretty major caveat - the original feature request for SSL support says this:

Using the built-in TLS stack. Sorry, no ability to add/manage certs here, just use the existing configuration.

So, as you've suggested, you'd need to add the certs manually to Chrome. There are facilities for importing and exporting in Settings -> Show advanced settings -> HTTPS/SSL -> Manage Certificates. You may also need to work around this bug by calling tcp.setPaused before tcp.secure.

But alternatively, if you need finer-grained control than the Chrome API provides, you can also add your own javascript TLS implementation on top of the normal Chrome TCP socket API. Luckily, the library forge already has one such implementation. You can see an example using forge in conjunction with chrome.sockets.tcp here. This approach gives much more granular control, enabling things like certificate pinning, etc., that aren't supported otherwise, but do be warned that forge does not yet support TLS 1.2 or ECDHE cipher suites (though these features are planned on the roadmap).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!