In 1956, as a response to withdrawal of American aid for the High Aswan dam, Nasser nationalized the Suez canal giving freedom of transit through it to all countries except Israel. Why did they do this? I know of the traditional Arab-Israeli rivalry, but what was responsible for this? Moreover, in the 1st article of the 1888 convention of Constantinople, it was decided that the canal would always be free for transit of all ships, irrespective of which country they belonged to. Wouldn't Egypt be going against this by not allowing the passage of Israeli ships?
Egypt did not recognise Israel as a country until 1979. Till then, it effectively considered Israel to be enemy-occupied Palestine. (A number of Muslim-majority countries still do.) Consequently, it did not deem Israeli shipping to be legitimate and therefore contended that the blockade did not contravene any agreements.
Israeli shipping in the Suez had been blocked by Egypt on and off ever since the partition. King Farouk pointedly ignored a UN resolution ordering the reopening of the canal in the 1951.
Egypt blocked shipping in both the Suez and the Straits of Tiran during the Six-day war as well.