https://kotlinlang.org logo
#ktor
Title
# ktor
a

Adriano Celentano

10/10/2019, 9:16 AM
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

molikuner

10/10/2019, 10:00 AM
If you know and own the domain in beforehand that should be possible.
a

Adriano Celentano

10/10/2019, 10:05 AM
So the Domain would need to Point to the IP of my Android device ?
m

molikuner

10/10/2019, 10:08 AM
Yeah, but be sure it's the public IP
a

Adriano Celentano

10/10/2019, 10:28 AM
But u think without having a domain, its rather very difficult ?
m

molikuner

10/10/2019, 10:41 AM
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

Adriano Celentano

10/10/2019, 11:50 AM
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

molikuner

10/10/2019, 11:57 AM
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

Adriano Celentano

10/10/2019, 12:02 PM
Yeah pls :)
And allready thanks a lot for your help, very appreciated !
2 Views