In this paper, we give a criterion of the nearly Gorenstein property of the Ehrhart ring of the stable set polytope of an h-perfect graph: the Ehrhart ring of the stable set polytope of an h-perfect graph G with connected components G (1) , . . . , G (ℓ) is nearly Gorenstein if and only if (1) for each i, the Ehrhart ring of the stable set polytope of G (i) is Gorenstein and (2) |ω(G (i) ) − ω(G (j) )| ≤ 1 for any i and j, where ω(G (i) ) is the clique number of G (i) .We also show that the Segre product of Cohen-Macaulay graded rings with linear non-zerodivisor which are Gorenstein on the punctured spectrum is also Gorenstein on the punctured spectrum if all but one rings are standard graded. MSC: 13H10,