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

Manager app doesn't follow redirect from server #76

Open
kobisamoray opened this issue Mar 28, 2020 · 5 comments
Open

Manager app doesn't follow redirect from server #76

kobisamoray opened this issue Mar 28, 2020 · 5 comments

Comments

@kobisamoray
Copy link

We have configured a HTTPS forwarder for our Traccar server.
While configuring Traccar Manager for Android URL upon first execution, configuring the HTTPS URL works. However, configuring the HTTP URL, while relying on redirection by the HTTPS forwarder, results with a server error.
Same configuration with the iPhone Traccar Manager app works well.
Specifying the HTTP URL in Chrome for Android obviously works.

@tananaev
Copy link
Member

You have to use proper proxy, not redirection.

@kobisamoray
Copy link
Author

@tananaev
I didn't explain my problem very well.
Our Apache configuration is as described here:
https://www.traccar.org/secure-connection/

So HTTPS listener is proxying the SSL requests locally to Traccar server as you advise.
Additionally we have a redirector for non-secure requests from the HTTP outbound listener, to the HTTPS listener.

We do have users who their apps are configured to use the HTTP listener, but the Android app fails to follow the redirector and fails with an error instead. The iOS app behaves well in that case.

@tananaev
Copy link
Member

If you proxied everything correctly and you have a valid SSL certificate, there should be no issues.

@kobisamoray
Copy link
Author

SSL Cert is not the issue is this works in both iPhone and in a browser (including Android's).
Tried debugging this a bit: seems like the following line receives the 302 message instead of the JSON object:
https://github.com/traccar/traccar-manager-android/blob/master/app/src/main/java/org/traccar/manager/StartFragment.java#L80

That makes sense, as I guess that HttpURLConnection doesn't recourse the request while receiving 302

@tananaev
Copy link
Member

So you are using redirect. Just use correct URL from the beginning.

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