added SSL options, cleanup