Naval blockades of enemy ports during war are legal, that is what USA and Israel argue they are doing. That is not what Iran is doing, they are blocking fully neutral ships from going in other countries waterways.
US at war? We are past the 60 days for a military operation. From US law perspective, it’s illegal. From the constitutional perspective only congress can declare war which they haven’t.
Are we at war with Cuba? US navy had been blockading the island from receiving fuel.