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

[SOLVED] Problem HTTPS (Mixed Content) #549

Closed
gianfelicevincenzo opened this issue May 3, 2020 · 8 comments
Closed

[SOLVED] Problem HTTPS (Mixed Content) #549

gianfelicevincenzo opened this issue May 3, 2020 · 8 comments

Comments

@gianfelicevincenzo
Copy link

gianfelicevincenzo commented May 3, 2020

Hi. My configuration of configuration.js:

// default authentication configuration, never fill it in case the webui is hosted in public IP as it can be compromised
    host: location.protocol.startsWith("http") ? location.hostname : "localhost",
    path: "/jsonrpc",
    port: 6800,
    encrypt: true,
    auth: {
      // either add the token field or the user and pass field, not both.
       token: 'MYTOKEN'
      /*-----------------------------*/
      // user: '*YOUR_USERNAME*',
      // pass: '*YOUR_SECRET_PASS*'
    },

Configuration of apache (site aria2.conf):

<VirtualHost *:443>
   ServerName aria.home.io
   DocumentRoot /var/www/html/webui-aria2/docs
   
   ProxyPass /jsonrpc wss://127.0.0.1:6800/jsonrpc
   ProxyPassReverse /jsonrpc wss://127.0.0.1:6800/jsonrpc
</VirtualHost>

Messages of firefox:

test

Why does the "Mixed Content" message always appear if everything has been set to a secure connection?

@no1xsyzy
Copy link
Contributor

no1xsyzy commented May 4, 2020

IIRC configuration.js is not working, resulting that Web-UI is falling back to http://<samehost>:6800, which is unsafe mixed content.
BTW if I guessed correctly, you should ProxyPass to ws://127.0.0.1:6800/json, for you shouldn't create a certificate for 127.0.0.1.

@gianfelicevincenzo
Copy link
Author

gianfelicevincenzo commented May 4, 2020

So, the problem is with webui-aria2? If so, how can this be resolved?

@no1xsyzy
Copy link
Contributor

no1xsyzy commented May 5, 2020

For now, only #417 way works nobly.
If you want to dig a little bit, #473 (comment) will also be helpful.

@gianfelicevincenzo
Copy link
Author

Thanks...but I noticed that this problem has been around for a long time ... why hasn't it "been solved" yet?

@no1xsyzy
Copy link
Contributor

no1xsyzy commented May 6, 2020

This project was switched to modern build system, but no one was familiar with that. The building system requires developer to have the entire node environment, which deactivates potential developers even more.
I am sticking to version before that happens.

@gianfelicevincenzo
Copy link
Author

gianfelicevincenzo commented May 6, 2020

@no1xsyzy I finally solved it! But I had to edit the app.js file like this (on the following lines):

Before:

170 .constant("$authconf", {
172 host: location.protocol.startsWith("http") ? location.hostname : "localhost",
173 path: "/jsonrpc",
174 port: 6800,
175 encrypt: !1,
176 auth: {},
177 directURL: ""
178 })
....
....
320 u.push(
321 { host: r.host(), path: "/jsonrpc", port: 6800, encrypt: !1 },
....
....

After:

170 .constant("$authconf", {
172 host: location.protocol.startsWith("http") ? location.hostname : "localhost",
173 path: "/jsonrpc",
174 port: 443,
175 encrypt: true,
176 auth: {},
177 directURL: ""
178 })
....
....
320 u.push(
321 { host: r.host(), path: "/jsonrpc", port: 443, encrypt: true },
....
....

Now could you tell me (unfortunately I'm not javascript expert :) ) if something is missing or is it a correct modification? (Obviously the static parameters are the ones I set as they reflect my needs)

@gianfelicevincenzo gianfelicevincenzo changed the title Problem HTTPS (Mixed Content) [SOLVED] Problem HTTPS (Mixed Content) May 6, 2020
@no1xsyzy
Copy link
Contributor

no1xsyzy commented May 7, 2020

If it works, it is correct.

BTW to mark it solved, you are suggest to "close" it instead of change the title. Conversation can continue after closed, as long as collaborators didn't "lock" it, which usually doesn't happen here since owner and collaborators are not so active and there is no bot locker.

@gianfelicevincenzo
Copy link
Author

Sorry, you are right :). More than anything else I was waiting for a "definitive" answer to be able to close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants