Ensure ssl socket is closed on shutdown
Merge pull request #2 from tiago-loureiro/issue-44-pr

Ensure ssl socket is closed on shutdown