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

Bart

09/11/2021, 2:42 PM
Hello All, Im trying to learn how to create ktor server. I tried to configure self-signed SSL. But it ends with confussion. I have main fun looks like this:
Fun main(arqs: Array<String>): Unity = io.ktor.server.jetty.EngineMain.main(arqs)
If I understand correctly i need to create certificate before server in fun main. So its should goes like this:
Copy code
fun main(arts: Array<String>{
<My certificate code>
Unity = io.ktor.server.jetty.EngineMain.main(arqs)
}
As it cant be done like this, how it can be configured? Examples that i find are created for embeddedServer so i can't use it.
a

Aleksei Tirman [JB]

09/13/2021, 10:37 AM
Please read Ktor's SSL documentation. Also, there is a sample project where HOCON configuration is used instead of
embeddedServer
.
👍 1
b

Bart

09/13/2021, 4:05 PM
Thank You, I probably skip begining of page by mistake