I have a PostgreSQL+PostGIS installed on GCP, with SSL/TLS enabled. I can connect just fine from the QGIS Browser panel, but when I try using the Database Manager or Export to PostgreSQL tool I get the below error. I have added the generated certificates and keys in the Authorities and Identities in the Certificate Manager menu.
I can also connect successfully to the DB using the aforementioned certificates from pgAdmin 4 v6.
Similar questions at Error connecting to a PostgreSQL database from QGIS using SSL certificates and QGIS can't connect to PostGIS but pgAdmin4 works, also here and here mentions about being a bug, but the posts are quite old, maybe a solution/workaround exists and I just did not found it yet.