The root cause of the issue was that I had generated an incorrect certificate file.
By setting the CN (Common Name) to exactly match the desired domain,
checking System Certificates and HTTP: Fetch Additional Support in the settings,
and registering the certificate in the keychain, the connection works properly.