Only use ssl if context is passed in