honor ssl setting when finding endpoint url