Added SSL support.

fully functioning SSL now supported. could use some cleaning of tiny workaround, suggest embedding <if> in <try> and renaming a few variables.