API Access from https failed #1912

Closed
opened 2022-03-30 05:31:45 +00:00 by twei · 13 comments

Hi there,

I received the following error on a fresh vikunja installation.

In Chrome Developer Console

Mixed Content: The page at 'https://vikunja.example.org/api/v1/info' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://vikunja.example.org/api/v1/info'. This request has been blocked; the content must be served over HTTPS.

FWIW I set the whole thing up with traefik, docker compose and vikunja. CORS defaults to true. Perhaps you would have an idea where this issue comes from?

Hi there, I received the following error on a fresh vikunja installation. In Chrome Developer Console > Mixed Content: The page at 'https://vikunja.example.org/api/v1/info' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://vikunja.example.org/api/v1/info'. This request has been blocked; the content must be served over HTTPS. FWIW I set the whole thing up with traefik, docker compose and vikunja. CORS defaults to true. Perhaps you would have an idea where this issue comes from?
Owner

Does it work? Are you able to use the frontend?

Does it work? Are you able to use the frontend?
Author

No, it didn't work, as the frontend could not communicate with the backend

No, it didn't work, as the frontend could not communicate with the backend
Owner

Can you show your config? Did you configure an API Url in the frontend container?

Can you show your config? Did you configure an API Url in the frontend container?
Author

Sorry, upon closer inspection, chrome cached a misconfigured API frontend page, and I couldn't get it to work. However, when I switch to a different profile, it will work. Do you have any suggestion on how to clearing the cache? I unregistered the workers but it still didn't work.

Sorry, upon closer inspection, chrome cached a misconfigured API frontend page, and I couldn't get it to work. However, when I switch to a different profile, it will work. Do you have any suggestion on how to clearing the cache? I unregistered the workers but it still didn't work.
Owner

If you manually changed the api URL in the frontend, it is saved in local storage. But you should be able to just change it back.

Does it work if you open the page in a private window?

If you manually changed the api URL in the frontend, it is saved in local storage. But you should be able to just change it back. Does it work if you open the page in a private window?
Author

Sadly manually changing the API URL doesn't work if I refresh the page. I have to do a hard reset in developer tools to get it working correctly.

Sadly manually changing the API URL doesn't work if I refresh the page. I have to do a hard reset in developer tools to get it working correctly.
Owner

You mean in local storage? That's where the api url is stored when manually changed.

You mean in local storage? That's where the api url is stored when manually changed.
Owner

Just to be sure we're on the same page here, you're changing the API url in the frontend here:

image

and then in the input field that pops up after clicking on "change" - is that correct?

Just to be sure we're on the same page here, you're changing the API url in the frontend here: ![image](/attachments/d133c1b1-1aea-4ea9-ac49-c210f90f1f61) and then in the input field that pops up after clicking on "change" - is that correct?
Author

exactly, yes

exactly, yes
Owner

Can you reproduce that on try?

Can you reproduce that on try?
Author

Huh I failed to reproduce that on try. FWIW I first used the env variable VIKUNJA_API_URL to a wrong value. Then I removed the env and restarted from docker compose, but it stuck to the chrome. Firefox and safari worked fine though.

Huh I failed to reproduce that on try. FWIW I first used the env variable `VIKUNJA_API_URL` to a wrong value. Then I removed the env and restarted from docker compose, but it stuck to the chrome. Firefox and safari worked fine though.
Owner

That sounds like the problem is solved?

That sounds like the problem is solved?
Author

Yep, I'll close it for now. Thanks for the help.

Yep, I'll close it for now. Thanks for the help.
twei closed this issue 2022-04-03 04:35:50 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1912
No description provided.