简体   繁体   English

在HTTPS页面上访问HTTP以获取Cookie

[英]Access HTTP on HTTPS page to get Cookie

I'm aware of the many hacks, I tried to google it, but I didn't really find anything I could use. 我知道有很多黑客,我尝试过用Google搜索它,但是我并没有真正找到可以使用的东西。

I have an IP camera with some pretty dumb authentication system, which supports only HTTP. 我有一台IP摄像机,带有一些漂亮的哑认证系统,仅支持HTTP。

I need to show image from this camera on a HTTPS page, but the camera won't show anything until it's been "logged in", which sets a cookie for the camera IP. 我需要在HTTPS页面上显示来自此摄像机的图像,但是在“登录”之前,该摄像机不会显示任何内容,这将为摄像机IP设置cookie。

I tried to open the login page (HTTP) with ajax, but chrome blocked it 我试图用ajax打开登录页面(HTTP),但是Chrome阻止了它

[blocked] The page at 'https://control_page_ip' was loaded over HTTPS, but ran
insecure content from 'http://camera_ip:8881/login.cgi?login_info':
this content should also be loaded over HTTPS.

All I need is to once access that http page and get the cookie. 我需要的是一旦访问该http页面并获取cookie。 Image will load fine over http - with a warning, but it will load. 图片会在http上正常加载-并带有警告,但会加载。

How to do this - the easiest way? 怎么做-最简单的方法? Ideally without any server-side helper stuff. 理想情况下,没有任何服务器端帮助程序。

Omg I've invented the stupidest hack on earth, and it worked! 天哪,我发明了地球上最愚蠢的骇客,而且行得通! I've fooled chrome into thinking the login page is an image :D 我欺骗chrome认为登录页面是图像:D

<img style="display:none" src="http://camera_ip:8881/login.cgi?login_info">

And it works fine - sets the cookie :) 它工作正常-设置cookie :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM