The notion of owning or monetizing an international waterway is fundamentally incompatible with customary international law. Iran can try it anyway if they're not worried about international law, but that was always an option for them, war or not. The timing of performing this extortion now seems to be mainly about scoring war propaganda points.
> fundamentally incompatible with customary international law
So is bombing countries on a whim.
If you want to take the high ground you have to make sure you don't first poison it with your own stupid mistakes. Iran can make a pretty credible play for reparations, and if the belligerents are unable or unwilling to pay up then Iran can selectively blockade the strait for their vessels and cargo. It is one of those little details that was 100% predictable going into this.
Panama Canal and Suez Canal require tolls, granted not exactly the same thing.