Exhibit 5.1

June 14, 2022

Hannon Armstrong Sustainable Infrastructure Capital, Inc.

One Park Place, Suite 200

Annapolis, MD 21401

Ladies and Gentlemen:

We have acted as counsel to Hannon Armstrong Sustainable Infrastructure Capital, Inc. (the “Company”) in connection with the offer and sale by the Company of 7,500,000 shares (the “Shares”) of its common stock, par value $0.01 per share (the “Common Stock”), pursuant to its 2022 Equity Incentive Plan (the “Plan”). The Common Stock is being sold pursuant to the Company’s Registration Statement on Form S-8 (the “Registration Statement”) under the Securities Act of 1933, as amended (the “Securities Act”).

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 and sold in the manner contemplated by the Registration Statement and the Plan, will be legally issued, fully paid and nonassessable.

The foregoing opinion is based as to matters of law solely on the applicable provisions of the General Corporation Law of the State of Maryland, 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.

This letter has been prepared for your use in connection with the Registration Statement 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 Securities and Exchange Commission (the “SEC”) as Exhibit 5.1 to the Registration Statement. 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 SEC thereunder.

Very truly yours,

/s/ Clifford Chance US LLP