סימן קפא סעיף יב
כָּל מִי שֶׁיּוֹדֵעַ עֵדוּת לַחֲבֵרוֹ וְרָאוּי לְהָעִידוֹ וְיֵשׁ לַחֲבֵרוֹ תּוֹעֶלֶת בְעֵדוּתוֹ וְהוּא תוֹבְעוֹ שֶׁיָעִיד לוֹ בִּפְנֵי בֵּית דִּין חַיָב לְהָעִיד לוֹ, בֵּין שֶׁיֵשׁ עוֹד עֵד אַחֵר עִמּוֹ, בֵּין שֶׁהוּא לְבַדּוֹ. וְאִם כָּבַשׁ עֵדוּתוֹ, חַיָב בְּדִינֵי שָׁמָיִם. וְאָסוּר לְאָדָם לְהָעִיד בְּדָבָר שֶׁאֵינוֹ יוֹדֵעַ, אַף עַל פִּי שֶׁאָמַר לוֹ אָדָם שֶׁיּוֹדֵעַ בּוֹ שֶׁאֵינוֹ מְשַׁקֵּר. וַאֲפִלּו אָמַר לוֹ בַּעַל הַדִּין, בּוֹא וַעֲמֹד עִם עֵד אֶחָד שֶׁיֵשׁ לִי, וְלֹא תָעִיד, רַק שֶׁיִפְחַד בַּעַל חוֹבִי וְיִסְבּוֹר שֶׁיֵשׁ לִי שְׁנֵי עֵדִים, וְיוֹדֶה לִי לֹא יִשְׁמַע לוֹ, שֶׁנֶּאֱמַר, מִדְּבַר שֶׁקֶר תִּרְחָק.
If you are able to bear witness for your neighbor and are qualified to testify, and your neighbor would benefit from your testimony, and asks you to testify on his behalf in the presence of Beis Din, you are obliged to testify, whether there is another witness besides you or you are the only one. If you withhold such testimony, you will have to answer to the Heavenly Court. It is forbidden to testify about anything you do not know (firsthand), and not even if the man who told you is someone you are certain that tells no lies. Even if the litigant says to you, "Come and stand next to the one witness that I have, not to testify, but just to intimidate my debtor, so he will think that I have two witnesses, and he will consequently admit (his obligation to me)," you must not listen to him, as it is said, "Keep far away from anything false."
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)