Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
301 views
in Technique[技术] by (71.8m points)

how to set the sha256 hex in envoy wasm remote config

As the below image shown, I want to load remote wasm in envoy filter, and I put the value in sha256 field, which is from my cli using sha256sum my_local_wasm_file | awk '{print $1}'. enovy_wasm_remote_config

But in the runtime, I got the below issue:

[2021-01-23 12:43:06.118][8][debug]
[config] [external/envoy/source/common/config/remote_data_fetcher.cc:52] 
fetch remote data [uri = http://192.168.3.147:8000/propaganda_filter.wasm]: 
data is invalid

So, I checked envoy code, as below shown: envoy_code

It's not clear that which cli cmd could do the same way. I tried other two ways, but both didn't work:

sha256sum target/wasm32-unknown-unknown/release/propaganda_filter.wasm 
| awk '{print $1}' | base64 

sha256sum target/wasm32-unknown-unknown/release/propaganda_filter.wasm 
| awk '{print $1}' 
| openssl dgst -sha256 -hmac $SECRET -binary | base64 

additional

I generate the sha256, firstly:

$ sha256sum target/wasm32-unknown-unknown/release/propaganda_filter.wasm  | awk '{print $1}' 
c171f5537f3233d80ab180fa468ada4b5d9d96c7249b230abc929ed77c5556ae

And then, I use an online tools(https://convertstring.com/EncodeDecode/HexEncode) to transfer the code:

enter image description here

Accordingly, I put the value into envoy config: enter image description here

But when I retry to restart envoy, it doesn't work,yet:

enter image description here

question from:https://stackoverflow.com/questions/65871312/how-to-set-the-sha256-hex-in-envoy-wasm-remote-config

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...