Rigidity and the distance between boundary points