Fix a few bugs in KeyStoreUtils
Add tests for basic SSL functionality