EXHIBIT 23.1 CONSENT OF ERNST & YOUNG LLP, INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM We consent to the incorporation by reference in the Registration Statements (Form S-3, Number 333-111861) of Finisar Corporation and in the related prospectuses and (Forms S-8, Numbers 333-89520, 333-107884, 333-111046, 333-65330, 333-32698 and 333-51920) pertaining to the 1989 Stock Option Plan, the 1999 Stock Option Plan, the 1999 Employee Stock Purchase Plan, the 2001 Nonstatutory Stock Option Plan of Finisar Corporation, the Transwave Fiber, Inc. Amended and Restated 2000 Stock Option Plan, the Medusa Technologies, Inc. 1999 Stock Option Plan, the Shomiti Systems, Inc. 1995 Stock Option Plan, the Sensors Unlimited, Inc. Second Amended and Restated 1997 Stock Option Plan and the Demeter Technologies, Inc. 2000 Stock Option Plan of our report dated June 3, 2004, with respect to the consolidated financial statements of Finisar Corporation included in this Annual Report (Form 10-K/A) for the year ended April 30, 2004. Our audits also included the financial statement schedule of Finisar Corporation listed in Item 15(a). This schedule is the responsibility of the Company's management. Our responsibility is to express an opinion based on our audits. In our opinion, the financial statement schedule referred to above, when considered in relation to the basic financial statements taken as a whole, presents fairly all material respects the information set forth therein. Palo Alto, California /s/ ERNST & YOUNG LLP August 26, 2004