I want to run ktor Server in an Android App. I hea...
# ktor
a
I want to run ktor Server in an Android App. I heard it is possible. But the Problem is i have to use tls. Can i also Provider a certificate ?
m
If you know and own the domain in beforehand that should be possible.
a
So the Domain would need to Point to the IP of my Android device ?
m
Yeah, but be sure it's the public IP
a
But u think without having a domain, its rather very difficult ?
m
That's what https kinda does. It verifies that the server that responds is the right server. So you could get a cert for an IP, but as you are on android, the chances that the IP is static, are very low. That said: how should the Android device connect to the internet? And do you want to be able to connect from everywhere or for example just from the same network?
a
It would be in the same network. I just heard i can use a self signed certificate. And the Client can Just say it trusts my certificate.
m
Okay, I thought you would like to create a public server. Then just create a certificate. And connect to the local IP. The public one isn't needed then. If you want to have some premium while accessing the server you could also create your own CA. You would not be forced to accept the certificate on every request. This would require to "install" the CA in all devices which request the server. If needed, I can link you to a good documentation for that.
a
Yeah pls :)
And allready thanks a lot for your help, very appreciated !