1

I have this code in my app

In res>xml>network_security_config.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config>
        <domain includeSubdomains="true">MY_DOMAIN.com</domain>
        <pin-set>
            <pin digest="SHA-256">MY_PIN</pin>
        </pin-set>
    </domain-config>
</network-security-config>

I found MY_PIN inserting MY_DOMAIN.com here: https://report-uri.com/home/pkp_hash

In manifest>AndoridManifest.xml

...
 <application
        android:networkSecurityConfig="@xml/network_security_config"

I load MY_DOMAIN in a WebView

But it's like if res>xml>network_security_config.xml is never opened and checked: if i change MY_PIN it still working and loading the page of MY_DOMAIN

Samuel Adorni
  • 208
  • 2
  • 14
  • What do you mean by "loading the page"? Do you mean `WebView`? If so, what version of Android are you running on, as `WebView` did not honor network security configuration in the beginning. – CommonsWare Apr 30 '19 at 16:48
  • @CommonsWare I'm developing on Android 8 (26 API, Oreo) and I use ```android.webkit.WebView``` in my app. In the onCreate i simply do: ```webView.loadUrl(MY_DOMAIN.com);``` I can not see my error, can you? Thanks – Samuel Adorni May 02 '19 at 08:15
  • [Solved in my another question](https://stackoverflow.com/a/56002828/10867716). Hope this helps. – Samuel Adorni May 06 '19 at 10:33

0 Answers0