Make sure this program's key and certificate files exist under dir, then set certificate and trust from them.
If the key/certificate files are missing or will not load they are deleted and created again with create_pem_files . Trust is the CA file already on disk. Anything else that goes wrong (cannot create the directory, cannot write a file, CA files unreadable) means the install is broken and aborts with GLib.error.