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

winget trying to download binary from HTTP instead of HTTPS #17

Open
anillo-uv opened this issue Jun 8, 2024 · 3 comments
Open

winget trying to download binary from HTTP instead of HTTPS #17

anillo-uv opened this issue Jun 8, 2024 · 3 comments

Comments

@anillo-uv
Copy link

Using dockers run of winget.pro. and external F5 LB as reverse proxy listening on HTTPS (443) redirecting traffic to HTTP (8000).

Everything works on clients but when trying to install any package, there is this GET:

Sending http GET request to: https://winget.mydomain.local/42f927d0-38ad-43ff-bafe-81260355ce61/packageManifests/MyProgram?Version=2.9

Then after I see this:
DeliveryOptimization downloading from url: http://winget.mydomain.local/media/42f927d0-38ad-43ff-bafe-81260355ce61/MyProgram-LpqmRpf6Ms.exe

Note that winget using HTTPS, but when winget is trying to download the package, then I see the HTTP in the download url.

@mherrmann
Copy link
Contributor

mherrmann commented Jun 8, 2024

I suspect you need to send the X-Forwarded-Proto from F5 LB, to tell winget.Pro that it's running on https.

@anillo-uv
Copy link
Author

Thanks, I couldnt make it work from the LB, managed to create the irule on the F5 and I see the header being sent. But it didnt work on ngnix docker side. I made it work just hardcoding this on the run/docker/nginx.conf file:

    location / {
        proxy_pass http://django;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto 'https';
    }

hardcoding to https there, django was able to generate proper JSON responses.

Just if this could help anyone on the same situation.
Regards,

@mherrmann
Copy link
Contributor

mherrmann commented Jun 13, 2024

Hm, I see. Is F5 LB talking to Nginx via http or https?

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