Closed Oreganon closed 1 year ago
It looks like you are double Base64 encrypting your SubscriptionInfo object.
Your code:
let subscription_info = SubscriptionInfo::new(
s.endpoint,
engine.encode(s.keys.p256dh),
engine.encode(s.keys.auth)
);
base64 encodes the already base64 encoded text from the client.
FYI, I would highly reccommend simply Serde deserializing directly into the rust_web_push SubscriptionInfo struct, rather than rolling your own, since this one already has serde support.
Ah thanks a lot. Working off the example I got it to work.
When sending out notification requests I get the following error:
The request is having invalid cryptographic keys
. The logging does not give any more information.How the keys are generated: https://github.com/Oreganon/bedge/blob/main/keygen.sh
The code: https://github.com/Oreganon/bedge/blob/main/src/main.rs#L22
Subscription info: