<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Android network security configuration not working in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-network-security-configuration-not-working/m-p/645716#M4437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;I'm developing an android app using ArcGIS Runtime SDK for Android 100.6.0 and it&amp;nbsp;is getting a SSLHandshakeException since I updated my app to use a &lt;A href="https://developer.android.com/training/articles/security-config" rel="nofollow noopener noreferrer" target="_blank"&gt;network security config&lt;/A&gt;.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;The app do requests to two servers. One of them is a REST API in a develpment server accessible only in my company network. The other one is a public server running an ArcGIS Server. The ArcGIS Server's domain is able to communicate over TLS 1.2.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;So, I expect everything to works just adding a rule to my private development server. This is the content of my network security config:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="prolog token"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;network-security-config&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;&lt;SPAN class="namespace token"&gt;xmlns:&lt;/SPAN&gt;android&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;http://schemas.android.com/apk/res/android&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;domain-config&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;cleartextTrafficPermitted&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;true&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
        &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;domain&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;includeSubdomains&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;true&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;172.17.1.14&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;domain&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;domain-config&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;network-security-config&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;‍‍‍‍‍‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Unfortunately, any requests to my ArcGIS Server (using ArcGIS Runtime SDK for Android) are resulting in the following exception:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Caused by&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; java&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;security&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;cert&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CertificateException&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; Domain specific configurations require that hostname aware &lt;SPAN class="token function"&gt;checkServerTrusted&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;X509Certificate&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; String&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; String&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; is used
        at android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;security&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;net&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;config&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RootTrustManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;checkServerTrusted&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;RootTrustManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;111&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;esri&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;arcgisruntime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;internal&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;checkServerTrusted&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SourceFile&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;161&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Platform&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;checkServerTrusted&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Platform&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;212&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ConscryptFileDescriptorSocket&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;verifyCertificateChain&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ConscryptFileDescriptorSocket&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;404&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NativeCrypto&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SSL_do_handshake&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Native Method&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NativeSsl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;doHandshake&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;NativeSsl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;375&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ConscryptFileDescriptorSocket&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;startHandshake&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ConscryptFileDescriptorSocket&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;224&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: #ffffff;"&gt;&lt;SPAN&gt;Since my ArcGIS Server server has a valid certificate and is TLS 1.2 aware, it would not happen, right?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;The following network security config works fine, but it is insecure:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="prolog token"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;network-security-config&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;&lt;SPAN class="namespace token"&gt;xmlns:&lt;/SPAN&gt;android&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;http://schemas.android.com/apk/res/android&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;base-config&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;cleartextTrafficPermitted&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;true&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
        &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;trust-anchors&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
            &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;certificates&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;src&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;system&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
        &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;trust-anchors&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;base-config&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;network-security-config&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;In addiction, I read that Facebook's Audience Network Android SDK also experienced issues with the network security configuration because they cache files at localhost. I've tried the same solution proposed by them but it also didn't work:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.facebook.com/docs/audience-network/android-network-security-config/" rel="nofollow noreferrer noopener" style="color: #005999; border: 0px; font-weight: inherit; text-decoration: underline;" target="_blank"&gt;https://developers.facebook.com/docs/audience-network/android-network-security-config/&lt;/A&gt;&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;What did I have done wrong? Does the Runtime SDK do intermediate requests like FB? Sniffing the android emulator network did not show up any requests other then expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 03:24:44 GMT</pubDate>
    <dc:creator>PlinioSantos</dc:creator>
    <dc:date>2021-12-12T03:24:44Z</dc:date>
    <item>
      <title>Android network security configuration not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-network-security-configuration-not-working/m-p/645716#M4437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;I'm developing an android app using ArcGIS Runtime SDK for Android 100.6.0 and it&amp;nbsp;is getting a SSLHandshakeException since I updated my app to use a &lt;A href="https://developer.android.com/training/articles/security-config" rel="nofollow noopener noreferrer" target="_blank"&gt;network security config&lt;/A&gt;.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;The app do requests to two servers. One of them is a REST API in a develpment server accessible only in my company network. The other one is a public server running an ArcGIS Server. The ArcGIS Server's domain is able to communicate over TLS 1.2.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;So, I expect everything to works just adding a rule to my private development server. This is the content of my network security config:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="prolog token"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;network-security-config&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;&lt;SPAN class="namespace token"&gt;xmlns:&lt;/SPAN&gt;android&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;http://schemas.android.com/apk/res/android&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;domain-config&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;cleartextTrafficPermitted&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;true&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
        &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;domain&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;includeSubdomains&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;true&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;172.17.1.14&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;domain&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;domain-config&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;network-security-config&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;‍‍‍‍‍‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Unfortunately, any requests to my ArcGIS Server (using ArcGIS Runtime SDK for Android) are resulting in the following exception:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Caused by&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; java&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;security&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;cert&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CertificateException&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt; Domain specific configurations require that hostname aware &lt;SPAN class="token function"&gt;checkServerTrusted&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;X509Certificate&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; String&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; String&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; is used
        at android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;security&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;net&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;config&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RootTrustManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;checkServerTrusted&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;RootTrustManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;111&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;esri&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;arcgisruntime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;internal&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;checkServerTrusted&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SourceFile&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;161&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Platform&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;checkServerTrusted&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Platform&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;212&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ConscryptFileDescriptorSocket&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;verifyCertificateChain&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ConscryptFileDescriptorSocket&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;404&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NativeCrypto&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SSL_do_handshake&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Native Method&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NativeSsl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;doHandshake&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;NativeSsl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;375&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        at com&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;android&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;org&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;conscrypt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ConscryptFileDescriptorSocket&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;startHandshake&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ConscryptFileDescriptorSocket&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;java&lt;SPAN class="operator token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;224&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: #ffffff;"&gt;&lt;SPAN&gt;Since my ArcGIS Server server has a valid certificate and is TLS 1.2 aware, it would not happen, right?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;The following network security config works fine, but it is insecure:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="prolog token"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;network-security-config&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;&lt;SPAN class="namespace token"&gt;xmlns:&lt;/SPAN&gt;android&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;http://schemas.android.com/apk/res/android&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;base-config&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;cleartextTrafficPermitted&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;true&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
        &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;trust-anchors&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
            &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;certificates&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;src&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;system&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
        &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;trust-anchors&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;base-config&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;network-security-config&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;In addiction, I read that Facebook's Audience Network Android SDK also experienced issues with the network security configuration because they cache files at localhost. I've tried the same solution proposed by them but it also didn't work:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.facebook.com/docs/audience-network/android-network-security-config/" rel="nofollow noreferrer noopener" style="color: #005999; border: 0px; font-weight: inherit; text-decoration: underline;" target="_blank"&gt;https://developers.facebook.com/docs/audience-network/android-network-security-config/&lt;/A&gt;&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;What did I have done wrong? Does the Runtime SDK do intermediate requests like FB? Sniffing the android emulator network did not show up any requests other then expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:24:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-network-security-configuration-not-working/m-p/645716#M4437</guid>
      <dc:creator>PlinioSantos</dc:creator>
      <dc:date>2021-12-12T03:24:44Z</dc:date>
    </item>
  </channel>
</rss>

