Fixed protocol selection when https is active