Body does not pass verification

Hey guys

Getting “Body does not pass verification” for a simple HTML canister but with lots of larger files.

What could be the problem ?

1 Like

Can you tell a bit more about your canister?

  • Are you using the default asset canister? This has a massive impact on my answer.
  • Does this happen repeatedly or just occasionally? You could be hitting a bad replica or your system time could not match up with the IC time
  • Any browser console logs? Probably not I guess but there is a chance
1 Like

PROJECT ROOT ← App main folder
├── src
│ ├── index.html
├── assets
│ ├── Images
│ └── 10
│ └── 11
│ └── 12
└── 13

Plain html content showing lots of images

Have this external reference

 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css"
   integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
   crossorigin="anonymous" referrerpolicy="no-referrer" />
 <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js"
   integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
   crossorigin="anonymous" referrerpolicy="no-referrer"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.8.0/proj4.js"
   integrity="sha512-ha3Is9IgbEyIInSb+4S6IlEwpimz00N5J/dVLQFKhePkZ/HywIbxLeEu5w+hRjVBpbujTogNyT311tluwemy9w=="
   crossorigin="anonymous" referrerpolicy="no-referrer"></script>
 <style>

You are probably not serving the right certificate with your asset. But if you access your canister through <canister id>.raw.ic0.app instead of <canister id>.ic0.app things should work out. You’ll also have to turn of the redirect.

2 Likes

Thank severin. How to turn off the redirect ?

Have a look at this changelog entry: sdk/CHANGELOG.md at master · dfinity/sdk · GitHub
You also have to change the match to hit every file instead of just one. Most likely you want "match": "**/*"

1 Like

Hi @Severin
I have same issue, but in my case the behaviour is very weird. I’ve deployed our custom FE canister which contains VerifiedCredentials issuer logic, and, some period it was working well so our guys and OpenChat guys (and @andronikos_nedos as well) were able to create a profile on our platform and issue PoH VC. But few days later, the canister started to respond with “Body does not pass verification” error, so we decided to redeploy the canister without any changes in code, just redeploy, and it helped, BUT, not for a long time…
You can visit our FE[h433y-uqaaa-aaaah-qdbja-cai], at the moment its “broken”. I’m hardly trying to figure out what can be the cause for such behaviour, and I will be very appriciated if you can give me any advice.

That is weird… I don’t have much to offer, but maybe you can copy how we do our unit tests for the asset canister? Here is how I check that the asset canister produces valid certificates

@NathanosDev any idea why it would work sometimes and not other times?

It seems that the root hash of the tree does not match the canister’s certified variable, so my guess is that the certified variable is not being updated when the tree is updated, or the witness is not being correctly constructed.

There may be some interference from the VerifiedCredentials issuance logic, since canister signatures are also leveraging certified variables. This may explain why deploying the canister fixes it temporarily.

Creating some unit tests to verify the behaviour of the canister as Severin suggested would be the best path forward here in my opinion.

1 Like

Thanks for your advices @Severin @NathanosDev .
I’ll check carefully tests logic and add such to my code.
Btw, I believe that it worth to mention that the issue appears not after VC issuance, but right after VC requested by third party( OC in our case ), and VCs were always delivered properly, I mean VC response was always correctly constructed.

Yep, I can confirm that update_root_hash was the cause. I had it for assets init only, but, after I’ve added it to prepare_credentials() - everything goes smoothly.
Thanks for your support @Severin @NathanosDev !

2 Likes