The french leader that offered San Marino a route to a deep water port in 1797 was Napoleon Bonaparte.
When Napoleon invaded Italy in 1797, he was very generous towards San Marino and respected the independence of the republic and even offered it an extension of it's territory, including a way to the sea, to a deep water port.