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
Use manual memory allocation to avoid errors in DebugAllocator