Searching for 'captain' in the TESB and ROTJ scripts is inconclusive the script refers to him as a 'star captain' at one point in ROTJ, but no one refers to him as 'Captain' after he becomes a General. Is there a definitive source on whether this was his military rank in the Alliance, or just in reference to his being captain of the Millennium Falcon? In The Empire Strikes Back and Return of the Jedi, many also refer to him as 'Captain Solo', including various Rebels (Luke, Zev Senesca), droids (C-3PO), Imperials (Darth Vader), and others (Boba Fett, Jabba).
In A New Hope, Han introduces himself as the captain of the Millennium Falcon.