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

Heroku SSL termination breaks Transport Security for downloads #163

Open
Eugeny opened this issue Nov 28, 2018 · 6 comments
Open

Heroku SSL termination breaks Transport Security for downloads #163

Eugeny opened this issue Nov 28, 2018 · 6 comments

Comments

@Eugeny
Copy link

Eugeny commented Nov 28, 2018

When deploying to Heroku, the download URLs will use http:// instead of https:// as getFullUrl() uses req.protocol, which is always 'http' on Heroku

@Joshandrews43
Copy link

I am getting NSURLErrorDomain, code=-1022 when I try to use autoUpdater which I have traced back to this issue as well. Any luck resolving it?

@Eugeny
Copy link
Author

Eugeny commented Dec 10, 2018

I've just patched my instance to force https for the time being

@Joshandrews43
Copy link

Joshandrews43 commented Dec 10, 2018

@Eugeny Hmm odd, I patched it partially it seems as now I am getting "updates available" but then afterwards am receiving the NSURLErrorDomain message before the download completes / begins. I am running it from a heroku server and have my domain set as:
'https://appname.herokuapp.com/update?version=' + version + '&platform=' + platform;

Potentially has to do with a redirect occuring from the URL above to:
'https://appname.herokuapp.com/update/platform/version', such that the responding URL is not the same as the request? However, when I use the former URL as my initial, it gives me this -1022 error without even checking for updates.

Any ideas why it would all of a sudden be OK with the URL in the beginning (whereas before I wasn't even getting to "checking for updates") and then error for the download portion?

@Eugeny
Copy link
Author

Eugeny commented Dec 10, 2018

@Joshandrews43 check whether your URLs have https:// via the debug endpoint: https://.../update/win32/1

The feed URL format is /update/win32/:version as per https://nuts.gitbook.com/update-windows.html

@Joshandrews43
Copy link

@Eugeny Just solved my problem. I did end up using https, however I just got other errors afterwards. Turns out I had to install the application as a .dmg file to my computer and then issue updates to the heroku server as a .zip otherwise they wouldn't download (on mac). Not sure why; any idea?

@ddnetters
Copy link

For people running into this issue it can be solved by setting TRUST_PROXY to true in your heroku config vars

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

3 participants