If the openssl.cafile location is used on Windows with a portable path like openssl.cafile = "\dev\xampp\apache\bin\curl-ca-bundle.crt", Composer will fail to properly detect and validate it, falling back to the bundled CA instead.
Note the backslashes and the lack of a drive letter (i.e. d:).
Such a setup is used by the portable version of XAMPP on Windows. It checks the folder on the currently active drive for the process.
If the configuration is changed to openssl.cafile = "d:\dev\xampp\apache\bin\curl-ca-bundle.crt" it seems to work correctly.
I'm not 100% sure this can or should be solved by Composer, but wanted to keep track of the issue here nevertheless.
See related issue where this was detected: wp-cli/package-command#104 (comment)