fixed ssl client/server test; cleaned up memory leaks