Skip to content
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

Error subscribing to HTTP middlewares from HTTPS frontend #231

Closed
justinotherguy opened this issue Jan 23, 2015 · 13 comments · Fixed by #232 or #257
Closed

Error subscribing to HTTP middlewares from HTTPS frontend #231

justinotherguy opened this issue Jan 23, 2015 · 13 comments · Fixed by #232 or #257

Comments

@justinotherguy
Copy link
Member

Steps to reproduce:

Rolling back to "Merge pull request #204 from andig/fix-cdn-usage" (304f39b) removes the behaviour.

Does not occur with Safari 8.0.2 and Chrome 40.0 on OSX.

Regards, J.

@andig
Copy link
Contributor

andig commented Jan 24, 2015

No osx. Can you check in the developer pane how the rquest looks? Http body/ response?

@justinotherguy
Copy link
Member Author

Thanks for the good questions :-)

@andig
Copy link
Contributor

andig commented Jan 24, 2015

Reproducible on Windows FF35

@andig
Copy link
Contributor

andig commented Jan 24, 2015

@andig
Copy link
Contributor

andig commented Jan 24, 2015

Ok, Firefox is blocking "insecure content" on the https page. Once disabled, problem is gone. As you still have the problem, could you check what is being blocked by ff?

@andig
Copy link
Contributor

andig commented Jan 24, 2015

Found it. The public MW request is http, not https: http://demo.volkszaehler.org/middleware.php/entity.json?padding=jQuery21301786527374471366_1422097116416&_=1422097116417

Now need to find why and where...

@andig
Copy link
Contributor

andig commented Jan 24, 2015

Could you please check your options.json? How are the middlewares configured? Explicit http preventing https? If yes, could you check if this works:

remoteMiddleware: [{
    title: 'Volkszaehler Demo',
    url: '//demo.volkszaehler.org/middleware.php'
}],

@justinotherguy
Copy link
Member Author

bingo! :-)
options.js has the default setting (see https://github.com/volkszaehler/volkszaehler.org/blob/master/htdocs/frontend/javascripts/options.js#L39), so it is set to http, not https.
I'd prefer to set the default to https (or have another entry with https; one of them could have a hint in its description); I'm surprised that omitting the protocol actually works; so - despite my lack of understanding why - that does work as well. If this is the way it should behave without the protocol, we could set it to that, as well. My first choice would be https, though.
Your opinion?

@justinotherguy
Copy link
Member Author

Update:
Safari (on OSX as well as iOS) seems to dislike the new setting :-/
Apparantly the mix of http and https is the root cause.
Steps to reproduce:

@andig
Copy link
Contributor

andig commented Jan 28, 2015

@justinotherguy what is the specific error displayed in the firefox console (developer console, opens with F12 on Windows)? What are the HTTP request/ response?

@andig andig added Enhancement and removed Bug labels Jan 28, 2015
@andig
Copy link
Contributor

andig commented Jan 29, 2015

@justinotherguy the problem is your certificate. Try https://demo.volkszaehler.org/middleware.php/entity.json?padding=jQuery21304080840314272791_1422543722973&_=1422543722974

Firefox:

demo.volkszaehler.org uses an invalid security certificate. 
The certificate is not trusted because no issuer chain was provided. 
(Error code: sec_error_unknown_issuer)

Chrome:

This server could not prove that it is demo.volkszaehler.org; its security certificate is not trusted by your computer's operating system. This may be caused by a misconfiguration or an attacker intercepting your connection.

Proceed to demo.volkszaehler.org (unsafe)

NET::ERR_CERT_AUTHORITY_INVALID

Therefore, the solution to this problem must be:

  1. provide a real certificate if you want to use https
  2. change the setting back to http and ensure that http will remain available
  3. force every user to accept a security exception and document this behaviour
  1. ist actually what was in place before. It is valid as a default but not for demo when it's hosted on https.

For now, I'll change options.js back to http and you'll have to manually switch to your liking.

@andig
Copy link
Contributor

andig commented Feb 10, 2015

@justinotherguy can we close this?

@justinotherguy
Copy link
Member Author

  1. sorry for not responding any sooner!
  2. I don't think the cert is the issue - I have installed to root CA cert in my browser, the error message comes up anyway
  3. the error message (in FF, when I have set the URL to "http://" in options.js and access http://demo... is shown here: Error subscribing to HTTP middlewares from HTTPS frontend #231 (comment)
  4. apparantly my comment Error subscribing to HTTP middlewares from HTTPS frontend #231 (comment) ("bingo!") does not refer to your comment Error subscribing to HTTP middlewares from HTTPS frontend #231 (comment) ("url: '//demo"), but to your comment Error subscribing to HTTP middlewares from HTTPS frontend #231 (comment) ("Found it. The public MW request is http, not https") -> from what I can tell, using "url:'//demo" seems to fix all cases mentioned above (it's the setting that's still present in demo.volkszaehler.org).

I suggest, we'll set options.js to "url:'//demo" - agreed?

@andig andig changed the title Frontend shows 404 error when trying to subscibe public channels with FF on OSX Error subscribing to HTTP middlewares from HTTPS frontend Feb 21, 2015
andig added a commit that referenced this issue Feb 25, 2015
Switch to HTTPS if frontend is served on HTTPS.

Finally half-fixes #231 after chat with@justinotherguy
andig added a commit to andig/volkszaehler.org that referenced this issue Mar 26, 2015
Switch to HTTPS if frontend is served on HTTPS.

Finally half-fixes volkszaehler#231 after chat with@justinotherguy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants