Midrash Tanchuma, Vayigash §5.
Sefaria — Midrash Tanchuma, Vayigash 5:15
כֵּיוָן שֶׁרָאָה יוֹסֵף שֶׁהָיְתָה לָהֶם בּוּשָׁה גְדוֹלָה, אָמַר לָהֶן גְּשׁוּ נָא אֵלַי... וּכְשֵׁם שֶׁלֹּא פִיֵּס יוֹסֵף אֶת אֶחָיו אֶלָּא מִתּוֹךְ בִּכְיָה, כָּךְ כְּשֶׁיִּגְאַל הַקָּדוֹשׁ בָּרוּךְ הוּא אֶת יִשְׂרָאֵל, מִתּוֹךְ בִּכְיָה הוּא גוֹאֲלָם.
English: When Yosef saw their great shame, he told them to come near; he kissed each one and wept. Just as Yosef reconciled his brothers through weeping, so the Holy One will redeem Israel through weeping.
What Is Learned: The brothers’ shame is answered by Yosef’s visible reconciliation, and the midrash connects that reconciliation with the future redemption.