added ssl and client cert support