improved ssl serialization