How to intercept HTTPS query from a local machine without proxy?

I want to debug a query made by a HTTP library that uses OpenSSL for HTTPS (to Google APIs). Unfortunately it doesn’t support a proxy.

My guess was that reverse proxy mode should work for me. But the library is not happy, throwing “padding check failed” at me.

I have mitmproxy certificate installed as in docs. But when I opened the proxied url in Firefox it warned me that it doesn’t trust the certificate. The certificate for some reason is bound to google domains (though I opened localhost…?).

Am I missing something simple?