Adapt to the new TLS api.