abstract: We show how the classical rigidity theorem for convex surfaces is related to the variational properties of the Hilbert-Einstein functional. For a Riemannian metric on a manifold with boundary, the Hilbert-Einstein functional is the integral of the scalar curvature of the interior plus the integral of the mean curvature of the boundary.