Our app's security testing got a security issue related to certificate chain validation. It's CWE-296 https://cwe.mitre.org/data/definitions/296.html
To my knowledge, adding a certificate pinning solves this problem but I'm not sure if there is a way to do certificate chain validation without pinning.
OWASP-MASVS also mentions about CWE-296 here under references
Can someone please provide more knowledge on this? Possibly share some example app which does this.
We're using Okhttp
for networking!