Blockades are a legitimate tool in warfare. Their status under international law is a bit unclear, as the precedent is mostly about wars with a clear separation between belligerents and neutral parties, which is not that common anymore.
In any case, neutral ships are expected to comply with the blockade. Typically by staying out of the region or by approaching visibly and subjecting themselves to inspection. If they don't stop voluntarily and resist capture, they can be attacked.