Of course law requires a government, and international law requires an international government. There is no legitimate international government, so there is no such thing as legitimate international law.
A popular notion is that the United Nations is a legitimate world government, and that they have a right to impose rules and punishments on the rest of the world. Why a collection of dictatorships should have a right to act against democratic countries is rarely explained. The notion that any corrupt dictatorship has a right to impose their will on a democratic sovereign nation is idiocy.
There are sovereign countries, and there are treaties between them. There is nothing fundamentally wrong with signing a treaty with a dictatorship (if you believe it is in the interests of their disenfranchised populations) but that treaty is not a mandate to use against other democratic nations.
There is no such thing as international law.