The SSL socket client example in Ktor's documentat...
# ktor
e
The SSL socket client example in Ktor's documentation is:
Copy code
val selectorManager = SelectorManager(<http://Dispatchers.IO|Dispatchers.IO>)
val socket = aSocket(selectorManager).tcp().connect("127.0.0.1", 8443).tls()
Trying to call
tls()
I get the following error. Is the example outdated, or am I missing a piece?
a
Have you added the
io.ktor:ktor-network-tls
dependency to your project?
e
@Aleksei Tirman [JB] sure! Without that you don't get the
tls
function at all
a
The example is broken.
✔️ 1
e
I wonder why it needs another coroutine context. Can't it reuse the Socket one?
e
Yep, you can reuse
gratitude thank you 1