Protocol over https

Fung4 years ago

Hallo at all,

what protocol does Traccar Client use over https?

I try to directly use the online tracking feature of OsmAnd with https.
When I put the url of my server with https into the Traccar Client app (without a port) it just works. But when I put the osmand protocol URL with https and without a port into the online tracking feature of OsmAnd it does not work.
When I put the local IP and port 5055 as server address into OsmAnd and use it with VPN or in my local network, it works fine.
But I would like to be able to use https with OsmAnd. So my questions are: How does it work in Traccar Client and how could I make it work in OsmAnd as well?

Thank you to everyone who will help me :-)

Anton Tananaev4 years ago

If you want to use HTTPS with OsmAnd port, you have to add HTTPS proxy in front of it. You can use Apache, nginx or any other server to do that.

Fung4 years ago

Ok, I will look into this. But how does the Traccar Client App work over https?

Anton Tananaev4 years ago

Sorry, I don't really understand the question.

Fung4 years ago

When I set the tracking server URL in the Traccar Client App to https://myserver.com (my domain is of course not 'myserver', this is just a placeholder), it reports the position successfully to my server. I do not specify any port and it works.
I analyzed the traffic per app and there was only https traffic over port 443 from the Traccar Client app.
Since the protocol of the app should be the osmand-protocol I was wondering how this works.

Anton Tananaev4 years ago

Default port for HTTPS is 443. It works because you have a proxy that converts HTTPS to HTTP and forwards that request to Traccar. Then Traccar also has a proxy that takes web port (8082 by default) and forwards it to correct OsmAnd port, which is 5055 by default. As you can imagine, it's not very efficient, so you should configure your original proxy to send directly to OsmAnd port.

Fung4 years ago

Ah, ok thanks for the clarification. What I do not understand is: Why is it not working with OsmAnd and port 443?

Anton Tananaev4 years ago

Not sure I understand the question. Please clearly provide all configuration details. Proxy, ports on the server, client etc.

Fung4 years ago

I set the Server URL for OsmAnd to https://myserver.com/?id=123456&lat={0}&lon={1}&timestamp={2}&hdop={3}&altitude={4}&speed={5} and it does not work. And when I set it to https://myserver.com:443/?id=123456&lat={0}&lon={1}&timestamp={2}&hdop={3}&altitude={4}&speed={5} it does not work either.

Anton Tananaev4 years ago

That doesn't make any sense to me. There is no difference.

Fung4 years ago

Ah sorry, I was unclear. My real question is, why is it not working with OsmAnd with this URL https://myserver.com/?id=123456&lat={0}&lon={1}&timestamp={2}&hdop={3}&altitude={4}&speed={5} but it is working with Traccar Client app with https://myserver.com as tracking server URL.

Anton Tananaev4 years ago

Because it already uses OsmAnd protocol. You don't need to include any query parameters.

Fung4 years ago

Maybe I missunderstood you, but what I am doing is:
I set this URL https://myserver.com/?id=123456&lat={0}&lon={1}&timestamp={2}&hdop={3}&altitude={4}&speed={5} as 'online tracking web address' in the app OsmAnd and it does not work.
I set this URL https://myserver.com as tracking server URL in the app Traccar Client and it does work.
My question is, why is it working over port 443 with the app Traccar Client but not with the app OsmAnd?

Anton Tananaev4 years ago

I've never used OsmAnd app, so wouldn't know. Next time please make a clear distinction when you are talking about OsmAnd app vs OsmAnd protocol.

Anton Tananaev4 years ago

Actually, I think I know why. You should be using correct port. Internal proxy, that I talked about earlier, only forwards POST requests. OsmAnd app is probably using GET request.