Exhibit 23.7

Consent of Independent Auditors

We consent to the incorporation by reference in this registration statement on Form S-3 of Hannon Armstrong Sustainable Infrastructure Capital, Inc. of our report dated April 29, 2021, with respect to the consolidated financial statements of Rosie TargetCo LLC and subsidiaries, which report appears in the December 31, 2021 annual report on Form 10-K/A of Hannon Armstrong Sustainable Infrastructure Capital, Inc. dated March 31, 2022 and to the reference to our firm under the heading “Experts” in the prospectus.

/s/ KPMG LLP

Philadelphia, Pennsylvania

June 14, 2022