Probably from cock + sure, early 16th c.
cocksure (comparative more cocksure, superlative most cocksure)
- (informal) too confident; overconfident
I thought myself cocksure of the horse which he readily promised me. — Alexander Pope
1906, John Galsworthy, “preface”, in The Man of Property:
- The persistence of the Past is one of those tragicomic blessings which each new age denies, coming cocksure on to the stage to mouth its claim to a perfect novelty.
1920, Sinclair Lewis, “XXIII”, in Main Street:
- These crack specialists, the young scientific fellows, they're so cocksure and so wrapped up in their laboratories that they miss the human element.