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