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
Aleksei Tirman [JB]
08/24/2023, 4:46 AM
Have you added the
io.ktor:ktor-network-tls
dependency to your project?
e
Edoardo Luppi
08/24/2023, 7:17 AM
@Aleksei Tirman [JB] sure! Without that you don't get the
tls
function at all
a
Aleksei Tirman [JB]
08/24/2023, 7:23 AM
The example is broken.
✔️ 1
e
Edoardo Luppi
08/24/2023, 9:19 AM
I wonder why it needs another coroutine context. Can't it reuse the Socket one?