Java : Unsafe custom SSL implementation (non-trivial)