-
Notifications
You must be signed in to change notification settings - Fork 369
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
Job files can't be loaded in Chrome when using HTTPS due to insecure content #50
Comments
|
|
And just to be clear, it's not just the load button, the delete and load+print buttons behave similarly. |
@guysoft the haproxy.cfg shipped with OctoPi apparently doesn't configure necessary environment variables (see here towards the end) for OctoPrint to generate the correct download URLs. That only causes problems in case of access via SSL (since it defaults to http if the X-Scheme header isn't set explicitely to https). |
Based on the haproxy recommendations on that page, I changed the frontends and backends as follows, and it seems to fix the problem. I left everything in the file above the frontend definitions alone. I tested this with one front end disabled (commented out), then the other, and finally with both enabled. It seems to work in all three cases for anything I could think to test aside from doing an actual print. frontend public frontend public-ssl backend octoprint backend octoprint-ssl |
We are still using 1.5-dev19, we could upgrade to 1.5.8. |
No need to upgrade haproxy (although it would of course be nice too), just |
@foosel Not sure how to do taht, if you could pull request I could release 0.10.1 with the fixed config and a bran new haproxy :) |
@guysoft Currently busy with other stuff, but if I'm not mistaken that should be enough: --- haproxy.cfg.old Sat Nov 8 13:55:02 2014
+++ haproxy.cfg.new Sat Nov 8 13:56:07 2014
@@ -28,6 +28,7 @@
backend octoprint
reqrep ^([^\ :]*)\ /(.*) \1\ /\2
+ reqadd X-Scheme:\ https if is-ssl
server octoprint1 127.0.0.1:5000
backend webcam |
Ok, So I will add a small fix to that. We released an experiential version and found it needs a bit of adjustment. Gina posted: https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.4-ssl_fc Link to that is here: |
As @foosel suggested in it http-request add-header X-Scheme https if { ssl_fc }
This works (also added to the corresponding OctoPrint wiki page):
|
I have no idea how that crept into a *copy and paste* but my guess is that that's the reason for guysoft#60 (at least it behaves exactly the same when I change my haproxy config to that). Sorry for that, again, I have no idea how that happened, I copy pasted the config.
I have no idea how that crept into a *copy and paste* but my guess is that that's the reason for guysoft#60 (at least it behaves exactly the same when I change my haproxy config to that). Sorry for that, again, I have no idea how that happened, I copy pasted the config.
I'm not sure whether this is an issue in Octoprint, Octopi or a combination since Octoprint doesn't do HTTPS on its own. It looks like some requests are still going over HTTP even though I'm accessing the server via HTTPS.
Chrome version is 38.0.2125.111 (64-bit) under Linux. In Chrome's developer console, I get the following when attempting to load a gcode file to print:
[blocked] The page at 'https://hostname.domain.com/' was loaded over HTTPS, but ran insecure content from 'http://hostname.domain.com/api/files/local/Z-Axis_LM8UU_Bearing_Holder.A6.gcode': this content should also be loaded over HTTPS.
x.support.cors.e.crossDomain.send jquery.min.js:6
x.extend.ajax jquery.min.js:6
GcodeFilesViewModel.self.loadFile files.js:142
click VM311:3(anonymous function) knockout.js:62
x.event.dispatch jquery.min.js:5y.handle
If I click on the shield at the top, to "load unsafe script", I receive the following message instead:
XMLHttpRequest cannot load http://hostname.domain.com/api/files/local/Z-Axis_LM8UU_Bearing_Holder.A6.gcode. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://hostname.domain.com' is therefore not allowed access.
This seems to have started happening sometime in October, but I'm not sure exactly when. I can replicate it using a fresh install from 2014-09-09-wheezy-octopi-0.10.0.zip (* master 644329c Preparing release of 1.1.1), as well as an install from 2014-01-07-wheezy-octopi-0.8.0.zip with Octoprint which had been periodically upgraded via the recommended method ultimately to whatever was available in Github as of the evening of 2014-11-05, which was where I originally discovered it.
The text was updated successfully, but these errors were encountered: