Added better port handling 

allow users to use a custom port over SSL