Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TrustKit-Android can’t support multi <domain> under the same <domain-config> #78

Open
BramYeh opened this issue Dec 30, 2020 · 0 comments

Comments

@BramYeh
Copy link

BramYeh commented Dec 30, 2020

Is your feature request related to a problem? Please describe.
TrustKit-Android can’t support multi under the same
This means it only deploys SSL public key pinning at the last domain, for example

<domain-config>
  <domain includeSubdomains="true">google.com</domain>
  <domain includeSubdomains="true">yahoo.com</domain>
  <domain includeSubdomains="true">verizon.com</domain>
<pin-set>
    <pin digest="SHA-256">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</pin>
    <pin digest="SHA-256">YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg=</pin>
  </pin-set>
</domain-config>

TrustKit only verifies the domain verizon.com’s certificate chain. Neither google.com nor yahoo.com

Describe the solution you'd like
Because TrustKit Android works by extending the Android N Network Security Configuration, it is good to support multi under the same

Describe alternatives you've considered
If we want to enable SSL pinning to multi domain, even the same certificate chain, we need to separate the domain-config

<domain-config>
  <domain includeSubdomains="true">google.com</domain>
  <pin-set>
    <pin digest="SHA-256">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</pin>
    <pin digest="SHA-256">YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg=</pin>
  </pin-set>
</domain-config>
<domain-config>
  <domain includeSubdomains="true">yahoo.com</domain>
  <pin-set>
    <pin digest="SHA-256">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</pin>
    <pin digest="SHA-256">YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg=</pin>
  </pin-set>
</domain-config>
<domain-config>
  <domain includeSubdomains="true">verizon.com</domain>
  <pin-set>
    <pin digest="SHA-256">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</pin>
    <pin digest="SHA-256">YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg=</pin>
  </pin-set>
</domain-config>

Additional context
We can refer its test cases:
https://github.com/datatheorem/TrustKit-Android/blob/master/trustkit/src/androidTest/res/xml/network_security_config.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant