Sahih Muslim Book 8, Hadith Number 3245.

Chapter: Temporary marriage and its prohibition for all times to come.

This hadith has been narrated on the authority of Isma’il with the same chain of transmitters (and the words are): “We were young, so we said: Allah’s Messenger, should we not have ourselves castrated? But he (the narrator) did not say; we were on an expedition.”