title: Android M App Link Verification fails
body: <p>I define my app links as follows in <code>AndroidManifest.xml</code>:</p>
  
  <pre><code>&lt;intent-filter android:autoVerify="true"&gt;
      &lt;action android:name="android.intent.action.VIEW"/&gt;
      &lt;category android:name="android.intent.category.BROWSABLE"/&gt;
      &lt;category android:name="android.intent.category.DEFAULT"/&gt;
  
      &lt;data android:host="mysite.com" android:scheme="http"/&gt;
      &lt;data android:host="mysite.com" android:scheme="https"/&gt;
      &lt;data android:host="www.mysite.com" android:scheme="http"/&gt;
      &lt;data android:host="www.mysite.com" android:scheme="https"/&gt;
  &lt;/intent-filter&gt;
  </code></pre>
  
  <p>The app correctly detects URLs from the host correctly but prompts if the user would like to open them in the application or the browser because verification fails as seen in the Android monitor console:</p>
  
  <pre><code>01-17 15:44:28.847 7084-30015/? I/IntentFilterIntentSvc: Verifying IntentFilter. verificationId:2 scheme:"https" hosts:"mysite.com www.mysite.com" package:"com.site.myapp.android.flavor".
  01-17 15:44:29.821 7084-30015/? I/IntentFilterIntentSvc: Verification 2 complete. Success:false. Failed hosts:mysite.com,www.mysite.com.
  </code></pre>
  
  <p>My assetlinks.json file is located at <code>mysite.com/.well-known/assetlinks.json</code> and contains the correct package name and SHA256 hash. It is also accessible via http and https. I have verified the SHA hash matches that from the keystore by extracting the CERT.RSA file from the APK and using <code>keytool -printcert -file CERT.RSA</code></p>
  
  <p>I have tried calling <code>https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://domain1:port&amp;relation=delegate_permission/common.handle_all_urls</code> as well as using the <a href="https://developers.google.com/digital-asset-links/tools/generator" rel="nofollow noreferrer">google site Statement List Tester</a> and both return OK.</p>
  
  <p>I am using a Nexus device running Android 7 for testing.</p>
  
  <p>According to <a href="https://developer.android.com/training/app-links/index.html" rel="nofollow noreferrer">the documentation</a> I have done everything required for app linking to work. Is there anything else that I can check?</p>
  
  <p>My server is running IIS on Windows 7, I have already added application/json as a mimetype in the IIS and web.config files. Could it be failing because I am using a self-signed SSL certificate?</p>
  
  <p>EDIT: SingleHostAsyncVerifier also logs the verification failing. (replaced mysite with example and SHA hash)</p>
  
  <pre><code>01-17 15:44:29.817 7084-30017/? I/SingleHostAsyncVerifier: Verification result: checking for a statement with source a &lt;
  a: "https://www.example.com"
  &gt;
  , relation delegate_permission/common.handle_all_urls, and target b &lt;
  a: "com.mypackage.flavor"
  b &lt;
  a: "(SHA256 hash)"
  &gt;
  &gt;
  --&gt; false.
  01-17 15:44:29.820 7084-30016/? I/SingleHostAsyncVerifier: Verification result: checking for a statement with source a &lt;
  a: "https://example.com"
  &gt;
  , relation delegate_permission/common.handle_all_urls, and target b &lt;
  a: "com.mypackage.flavor"
  b &lt;
  a: "(SHA256 hash)"
  &gt;
  &gt;
  --&gt; false.
  </code></pre>