B'resheet 39:19-20 Now it came about when his master heard the words of his wife, which she spoke to him, saying, "This is what your slave did to me," that his anger burned. So Yosef's master took him and put him into the jail, the place where the king's prisoners were confined; and he was there in the jail.
It does not state here if Yosef said a word in his defense. Probably not, I doubt it would have done any good. Yeshua opened not his mouth either.
Mattityahu (Matthew) 27:12-14 And while He was being accused by the chief priests and elders, He made no answer. Then Pilate said to Him, "Do You not hear how many things they testify against You?" And He did not answer him with regard to even a single charge, so that the governor was quite amazed.
He knew this is why He came and it was the will of the Father. He also willingly laid down his life. It would have been sin not too. This is called a sin of omission. How could he not have done it? He said, the Father loves Him because He was willing to lay down his life. (John 10:17)
He loved the Father that much. He loves us that much.
Philippians 4:20 Now to our G-d and Father be all the glory forever and ever.
Yesha'yahu (Isaiah) 53:6-10 But the L-RD has caused the iniquity of us all to fall on Him. He was oppressed and He was afflicted, Yet He did not open His mouth; Like a lamb that is led to slaughter, and like a sheep that is silent before its shearers, So He did not open His mouth. By oppression and judgment He was taken away; and none His generation, protested That He was cut off out of the land of the living, For the transgression of my people to whom the stroke was due? His grave was assigned with WICKED men, Yet He was with a rich man in His death, Because He had done no violence, nor was there any deceit in His mouth. But the L-RD was pleased to crush Him, putting Him to grief;
We learn more from the writer of Tehillim (Psalms) about Yosef's time in prison.
Tehillim (Psalms) 105:17-19 He sent a man before them, Yosef, who was sold as a slave. They afflicted his feet with fetters, He himself was laid in irons; until the time that his word came to pass, The word of the L-RD tested him.
B'resheet 39:21-23 But the L-RD was with Yosef and extended kindness to him, and gave him favor in the sight of the chief jailer. And the chief jailer committed to Yosef's charge all the prisoners who were in the jail; so that whatever was done there, he was responsible for it. The chief jailer did not supervise anything under Yosef's charge because the L-RD was with him; and whatever he did, the L-RD made to prosper.
The L-RD was with Yosef - Here again is another time when Yosef is dealt with unfairly. He could have used this as an excuse to turn his back on G-d. But he does not and the L-rd was with him during his time in prison.
Yosef's going to jail with WICKED men and taking charge over the prisoners is not unlike the Messiah. It is symbolic of the future event when Yeshua would go down to Avraham's bosom and release the prisoners after His death.
Yesha'yahu (Isaiah) 61:1 The Spirit of the L-rd G-D is upon me, Because the L-RD has anointed me to bring good news to the afflicted; He has sent me to bind up the brokenhearted, to proclaim liberty to captives, And freedom to prisoners;
Mattityahu (Matthew) 27:50-53 And Yeshua (Jesus) cried out again with a loud voice, and yielded up His spirit. And behold, the veil of the temple was torn in two from top to bottom, and the earth shook; and the rocks were split, and the tombs were opened; and many bodies of the saints who had fallen asleep were raised; and coming out of the tombs after His resurrection they entered the holy city and appeared to many.
The chief jailer may also symbolize the rich man, Yosef of Arimathea. (Matt. 27:57-60)