Bulugh al-Maram 718
وَعَنْهُ: سَمِعْتُ رَسُولَ اللَّهِ - صلى الله عليه وسلم - يَخْطُبُ يَقُولُ: «لَا يَخْلُوَنَّ رَجُلٌ بِامْرَأَةٍ إِلَّا وَمَعَهَا ذُو مَحْرَمٍ, وَلَا تُسَافِرُ الْمَرْأَةُ إِلَّا مَعَ ذِي مَحْرَمٍ»، فَقَامَ رَجُلٌ, فَقَالَ: ⦗٢٠٨⦘ يَا رَسُولَ اللَّهِ, إِنَّ امْرَأَتِي خَرَجَتْ حَاجَّةً, وَإِنِّي اكْتُتِبْتُ فِي غَزْوَةِ كَذَا وَكَذَا, قَالَ: «انْطَلِقْ, فَحُجَّ مَعَ امْرَأَتِكَ». مُتَّفَقٌ عَلَيْهِ, وَاللَّفْظُ لِمُسْلِمٍ.
From him: I heard the Messenger of Allah ﷺ giving a sermon, saying: "No man should be alone with a woman unless a mahram of hers is with her, and a woman should not travel except with a mahram." A man stood up and said: "O Messenger of Allah, my wife has gone out for Hajj, and I have been enlisted for such-and-such campaign." He said: "Go and perform Hajj with your wife." Agreed upon, and the wording is Muslim's.