Sahih al-Bukhari
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا عَمْرُو بْنُ عَوْنٍ، حَدَّثَنَا خَالِدٌ، عَنْ إِسْمَاعِيلَ، عَنْ قَيْسٍ، عَنْ عَبْدِ اللَّهِ، رضى الله عنه قَالَ كُنَّا نَغْزُو مَعَ النَّبِيِّ صلى الله عليه وسلم وَلَيْسَ مَعَنَا نِسَاءٌ فَقُلْنَا أَلاَ نَخْتَصِي فَنَهَانَا عَنْ ذَلِكَ، فَرَخَّصَ لَنَا بَعْدَ ذَلِكَ أَنْ نَتَزَوَّجَ الْمَرْأَةَ بِالثَّوْبِ، ثُمَّ قَرَأَ {يَا أَيُّهَا الَّذِينَ آمَنُوا لاَ تُحَرِّمُوا طَيِّبَاتِ مَا أَحَلَّ اللَّهُ لَكُمْ }
Narrated `Abdullah:
We used to participate in the holy wars carried on by the Prophet (ﷺ) and we had no women (wives) with us. So we said (to the Prophet (ﷺ) ). "Shall we castrate ourselves?" But the Prophet (ﷺ) forbade us to do that and thenceforth he allowed us to marry a woman (temporarily) by giving her even a garment, and then he recited: "O you who believe! Do not make unlawful the good things which Allah has made lawful for you."
Full reference and source
Sahih al-Bukhari USC-MSA web (English) : Vol. 6, Book 60, Hadith 139 Arabic : Book 65, Hadith 4615
View source on Sunnah.com (opens in a new tab)