Add ssl options. Refactor code.
Add ssl options. Refactor code.