Improved and fixed server SSL implementation. Added server ssl tests.
Merge pull request #886 from mdogan/fix/3.1/SSL

Improved and fixed server SSL implementation. Added server ssl tests.