Exhibit 5.1

July 23, 2024

HA Sustainable Infrastructure Capital, Inc.

One Park Place Suite 200

Annapolis, Maryland 21401

Re: Registration Statements on Form S-8 of HA Sustainable Infrastructure Capital, Inc.

We have acted as counsel to HA Sustainable Infrastructure Capital, Inc. (the “Company”) in connection with the filing by the Company with the Securities and Exchange Commission (the “Commission”) under the Securities Act of 1933, as amended (the “Securities Act”) of Post-Effective Amendment No. 1 to the Registration Statements on Form S-8, file nos. 333-265595, 333-230548, 333-212913 and 333-188070 (the “Registration Statements”) relating to up to 12,743,316 shares (the “Shares”) of the Company’s common stock, par value $0.01 per share (the “Common Stock”), which may be issued from time to time pursuant to the Company’s 2022 Equity Incentive Plan and its 2013 Equity Incentive Plan (the “Plans”).

In rendering the opinion expressed below, we have examined and relied upon originals or copies, certified or otherwise identified to our satisfaction, of such corporate records, documents, certificates and other instruments as in our judgment are necessary or appropriate. In examining all such documents, we have assumed the genuineness of all signatures, the legal capacity of all natural persons, the authenticity of all documents submitted to us purporting to be originals, and the conformity to the respective originals of all documents submitted to us as certified, telecopied, photostatic or reproduced copies or in portable document format.

Based on the foregoing, and such other examination of law and fact as we have deemed necessary, we are of the opinion that the Shares have been duly and validly authorized and, when issued in the manner and for compensation contemplated by the Registration Statements and the Plans, will be validly issued, fully paid and nonassessable.

The foregoing opinion is based as to matters of law solely on the applicable provisions of the Delaware General Corporation Law, as currently in effect. We express no opinion as to other laws, statutes, ordinances, rules or regulations, and we assume no responsibility for the applicability or effect of such laws, statutes, ordinances, rules or regulations of any other jurisdiction. In addition, we have assumed that the resolutions of the Company’s board of directors or its compensation committee authorizing the Company to issue and deliver the Shares pursuant to the Plans and the applicable award agreements will be in full force and effect at all times at which such Shares are issued and delivered by the Company, and that the Company will take no action inconsistent with such resolutions.

This letter has been prepared for your use in connection with the Registration Statements and is based upon the law as in effect and the facts known to us on the date hereof. We have not undertaken to advise you of any subsequent changes in the law or of any facts that hereafter may come to our attention.

We hereby consent to the filing of this opinion with the Commission as Exhibit 5.1 to the Registration Statements. In giving such consent, we do not thereby admit that we are within the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations of the Commission thereunder.

Very truly yours,

/s/ Clifford Chance US LLP