Li’an (Hadith No. 415)
Narrated Sahl bin Sa’d:
A man said, “O Allah’s Apostle! If a man finds another man with his wife, (committing adultery) should the husband kill him?” Later on I saw them (the man and his wife) doing Li’an in the mosque.
Li’an is an Islamic legal term meaning the mutual act of swearing is carried out before a judge when a husband accuses his wife of adultery and cannot prove it with four witnesses.
Read more on it here.
And by the way, the answer to the man’s question about killing the adulterer is a no. Li’an is the right thing to do.
Oh, and li’an can be done in a mosque as well, as in this particular Hadith.