Major refactoring of SSLConfig and certificate authentication