Read this legal background on the Gaza maritime blockade:
Maritime blockades are imposed regularly during times of armed conflict, or even perceived threat. For instance, the US maritime blockade of Cuba during the Cuban missile crisis. The US could not be certain that Soviet missiles in Cuba would actually be used against the US, but was justified nevertheless in stopping all maritime traffic to and from Cuba.
The maritime blockade of Gaza is even more legitimate, as the terrorists based there have fired thousands of rockets into southern Israel over the past several years, and did receive a large portion of those weapons via maritime transport.