It is narrated from Sayyiduna Ali (may Allah be pleased with him) that a man came to him and said: "I have committed an offence for which a hadd punishment is due." Sayyiduna Ali (may Allah be pleased with him) said (to his companions): "Ask him what it (the offence) is." But the man did not tell them about it, so Sayyiduna Ali (may Allah be pleased with him) said: "Beat him (until) he stops you (by telling the truth or from beating him further)." All the narrators of the chain of this narration are thiqat (trustworthy) and reliable.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب الحدود / 3491