handle both https and ssh version