The serialization should be done via the parameters. This also makes SSLContext::serialize redundant.