Refcounted SSL stream goes out of scope - fixes #846
Merge pull request #849 from etcimon/fix-https

Refcounted SSL stream goes out of scope - fixes #846