SWT 浏览器插件不提示进行代理身份验证
通过将 VM 参数 -Dnetwork.proxy_host 和 -Dnetwork.proxy_port 设置为相应的值,我已成功将 SWT 浏览器应用程序配置为使用代理。
但是,代理需要身份验证,但用户名/密码提示未打开。此外,在注册身份验证侦听器时,永远不会触发侦听器。
Linux Debian 64 位发行版出现了该问题。当为 Windows 编译相同的应用程序时,一切正常,即密码提示打开。 SWT 浏览器配置为使用 MOZILLA,而不是 WEBKIT。不幸的是,我无法使用 WEBKIT 进行测试,因为我仅限于给定的环境。
临时解决方案:启动Linux Mozilla浏览器时出现提示。如果输入正确的值并随后启动 SWT 浏览器应用程序,则根本不需要身份验证并且可以访问 Internet。但这不是一个好的解决方案。
当我使用“addLocationListener”注册位置侦听器以查看 url 调用发生的情况时,我可以看到初始 url(例如 www.google.de)结果调用代理服务器的某个 http 站点。这个http站点是重定向到代理的https站点。然后https站点会再次调用http重定向页面。这就是一个无限循环。 我猜想在 SWT 浏览器类的 JAVA 代码中的某个地方有一个例程调用这些页面的 setUrl (这会导致 无限循环)并由于某种原因跳过调用任何身份验证侦听器。
也许有人知道这个身份验证过程出了什么问题?
I have successfully configured my SWT Browser application to use the proxy by setting VM arguments -Dnetwork.proxy_host and -Dnetwork.proxy_port to the according values.
However the proxy needs authentication, but the username / password prompt does not open. Futhermore when registering an authentication listener, the listener is never triggered.
The problems occured with a Linux Debian 64 Bit distribution. When compiling the same application for windows, all works fine, i.e. the password promt opens. The SWT Browser is configured to use MOZILLA, not WEBKIT. Unfortunatelly I cannot test with WEBKIT as I am limited to a given environment.
Temp solution: When starting the Linux Mozilla Browser, the prompt comes up. If entering there correct values and afterwards starting the SWT Browser application, then no authentication is needed at all and internet access is possible. But this is not a good solution.
When I register a location listener with "addLocationListener" to look whats going on with url calls, then I can see that the initial url (for example www.google.de) results to call a certain http site of the proxy server. And this http site is a redirect to a https site of the proxy. Then the https site results in calling the http redirect page again. This is then an endless loop.
I would guess that somewhere in the JAVA code of the SWT Browser class there is a routine that calls setUrl with those pages (what results in an
endless loop) and skip to call any authentication listener for some reason.
Maybe someone has an idea whats going wrong in this authentication process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有解决方案,但有一个提示:我不确定你所说的“Linux Mozilla 浏览器”是什么意思 - 我知道 Firefox 和 Xulrunner。但您的解决方法表明个人资料信息以某种方式共享,并且这种情况不应该发生。
我试图找到一些如何定义配置文件的信息(Web 浏览器在其中保留其缓存、配置、SSL 证书、插件等),但无济于事。
常见问题解答中的此条目显示了如何设置代理主机: How do I set a proxy for the使用浏览器?
尝试找到一种方法将用户/密码信息添加到发送到代理服务器的请求中。如果失败,请创建一个本地代理,该代理作为上游连接到真实代理,并且可以对自身进行身份验证。
查看错误数据库,不支持浏览器配置文件: 灵活的 Mozilla 配置文件支持 -新的API请求
I have no solution but a hint: I'm not sure what you mean by "Linux Mozilla Browser" - I know Firefox and Xulrunner. But your workaround suggests that profile information is shared somehow and that shouldn't happen.
I tried to find some information how to define the profile (where the web browser keeps its cache, config, SSL certificates, plugins, ...) but to no avail.
This entry in the FAQ shows how to set the proxy host: How do I set a proxy for the Browser to use?
Try to find a way to add the user/password information into the request sent to the proxy server. If that fails, create a local proxy which connects to the real proxy as upstream and which can authenticate itself.
Looking at the bug database, there is no support for Browser profiles: Flexible Mozilla profile support - new API request