Closed MaRuifeng closed 5 years ago
Taking a look at the commit to fix issue #49 , below code portion indicates that only non-null DomainPinningPolicy
is added to the domainConfigSet
.
When instantiating the TrustKitConfiguration
object, the mentioned exception is thrown when the domainConfigSet
has a size less than 1.
This part may need to be reworked.
Thanks for the detailed report - it all makes sense.
Fixed in 1.1.2
Describe the bug In the
network_security_config.xml
file, if there is a domain-config block without any pin set like below, ancom.datatheorem.android.trustkit.config.ConfigurationException: Policy contains 0 domains to pin
exception will be thrown upon app launch which causes the app to crash. I believe this results from the fix to #49 .Exception stack trace from logcat:
To Reproduce Put above XML config block for clear text traffic in an RN (version >= 0.58) app with TrustKit module (v1.1.1) installed, run
react-native run-android
to install and launch it in an Android emulator. The app will crash upon launch and the above exception messages can be read via logcat.Expected behavior Domains without pin set should just be ignored as promised in the release notes of version 1.1.1.
TrustKit version 1.1.1
App details: App target SDK: 28.0.3 App language: JS/React Native Android version to reproduce the bug: Andorid 9.0.