Kotlin : Unsafe custom SSL implementation (non-trivial)