Adapted code due to ecdhe_context not being copyable anymore