Amr bin As sent him to Ali to seek permission to visit his wife Asma bint Umays. Ali granted him permission, and the two of them spoke about a matter she needed. When the freed slave came out, he asked Amr about that, and Amr said, "The Messenger of Allah ﷺ forbade us from seeking permission to visit women except with the permission of their husbands."
حدثنا بهز حدثنا شعبة قال أخبرني الحكم قال سمعت ذكوان أبا صالح يحدث
أن عمرو بن العاص أرسله إلى علي يستأذنه على امرأته أسماء بنت عميس فأذن له فتكلما في حاجة فلما خرج المولى سأله عن ذلك فقال عمرو نهانا رسول الله ﷺ أن نستأذن على النساء إلا بإذن أزواجهن
Its isnad is sahih. Tirmidhi narrated the hadith in 5/95, number 2779, in the chapter on manners, "What Has Been Said Regarding the Prohibition of Entering upon Women," and Ibn Abu Shayba narrated it similarly in 4/410, in the chapter on marriage.