select the correct port for ssl/non-ssl