I am following Apple's documentation to introduce NSPinnedDomains as the primary certificate pinning solution in our application.
We have a multiple environments to communicate to, and could have multiple subdomains, for example:
images.test-staging.backend.com
images.test-development.backend.com
image.backend.com
NSIncludesSubdomains documentation defines:
it doesn’t apply to the subdomains advanced.math.example.com or ancient.history.example.com because those subdomains have two additional path components.
I understand, I can define domains as per environment
test-staging.backend.com
test-development.backend.com
backend.com
but if the backend would return an additional two subdomain
pretty.images.test-staging.backend.com
t will not be pinned.
I have tried to set domains as wildcards (*.backend.com), but it does not work.
Has somebody managed to find a solution for pinning against multiple subdomains?