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

Caused by: com.datatheorem.android.trustkit.config.ConfigurationException: Tried to pin an invalid domain: <mydomain.com> #90

Open
mallikarjunch09 opened this issue Jun 9, 2021 · 3 comments

Comments

@mallikarjunch09
Copy link

mallikarjunch09 commented Jun 9, 2021

Hi I'm getting below error while running my application.

2021-06-09 16:46:02.179 13796-13796/packagename E/AndroidRuntime: FATAL EXCEPTION: main
Process: packagename, PID: 13796
java.lang.RuntimeException: Unable to create application packagename.Application: com.datatheorem.android.trustkit.config.ConfigurationException: Tried to pin an invalid domain: <mydomain.com>
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6465)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: com.datatheorem.android.trustkit.config.ConfigurationException: Tried to pin an invalid domain: <mydomain.com>

Android studio - 4.2.1
Android Gradle plugin verions - 4.2.1
Gradle version - 6.7.1
trustkit version - com.datatheorem.android.trustkit:trustkit:1.1.2

Could you please help me anybody ?

@mallikarjunch09 mallikarjunch09 changed the title Caused by: com.datatheorem.android.trustkit.config.ConfigurationException Caused by: com.datatheorem.android.trustkit.config.ConfigurationException: Tried to pin an invalid domain: <mydomain.com> Jun 9, 2021
@ben-j69
Copy link

ben-j69 commented Jun 23, 2021

Hello @mallikarjunch09 you should show your network_security_config.xml to have help.

@mallikarjunch09
Copy link
Author

mallikarjunch09 commented Jun 29, 2021

Hi @ben-j69 please check network_security_config.xml file
Please help me i'm struck with this since many days

<!--Added for cleartexttraffice error in android 9 and above-->
<base-config cleartextTrafficPermitted="true">
    <trust-anchors>
        <certificates src="system" />
    </trust-anchors>
</base-config>
<!-- Official Android N API -->
<domain-config enforcePinning="true">
    <domain includeSubdomains="true">domain name goes here
    </domain>
    <!-- Valid pins -->
    <pin-set>
        <pin digest="SHA-256">KEY goes here</pin>
        <pin digest="SHA-256">KEY goes here</pin>
    </pin-set>
    <trustkit-config
        disableDefaultReportUri="true"
        enforcePinning="true">
        <!-- Add a reporting URL for pin validation reports -->
        <report-uri>https://overmind.datatheorem.com/trustkit/report</report-uri>
    </trustkit-config>
</domain-config>

<domain-config enforcePinning="true">
    <domain includeSubdomains="true">domain name goes here</domain>

    <pin-set expiration="2021-03-14">
        <pin digest="SHA-256">KEY goes here</pin>
        <!-- backup pin-->
        <pin digest="SHA-256">KEY goes here</pin>

        <pin digest="SHA-256">KEY goes here</pin>
        <!-- backup pin-->
        <pin digest="SHA-256">KEY goes here</pin>

    </pin-set>
    <trustkit-config
        disableDefaultReportUri="true"
        enforcePinning="true">
        <!-- Add a reporting URL for pin validation reports -->
        <report-uri>https://overmind.datatheorem.com/trustkit/report</report-uri>
    </trustkit-config>
</domain-config>

@ben-j69
Copy link

ben-j69 commented Jun 29, 2021

@mallikarjunch09 if you read your error and your file this si crystal clear, you have invalid domain names like "domain name goes here". Just fix your config file.

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

2 participants