Sahih Muslim 1858
Sahih Muslim · Book 33: The Book on Government · It is recommended for the army to swear allegiance to the ruler when intending to fight, and an account of Bay'at Ar-Ridwan beneath the tree
وَحَدَّثَنَاهُ يَحْيَى بْنُ يَحْيَى ، أَخْبَرَنَا خَالِدُ بْنُ عَبْدِ اللَّهِ ، عَنْ يُونُسَ ، بِهَذَا الإِسْنَادِ .
This hadith has been narrated on the authority of Yunus with the same chain of transmitters.