Mr. Obama told U.S troops Friday at Bagram air base outside Kabul that the United States will not let Afghanistan be a safe haven for terrorists to attack America .