pimeys / rust-web-push

A Web Push library for Rust
Apache License 2.0
113 stars 21 forks source link

Determine which Push implimentations need aesgcm vs aes128gcm #42

Closed andyblarblar closed 1 year ago

andyblarblar commented 1 year ago

It seems that some endpoints still want aesgcm, while some (like edge) require aes128gcm. This currently makes it quite hard for users to simply create a web push message, as they must commit to one encoding or the other, or make their own logic to decide which to use.

We should add a method to the pushSubscription struct that returns the correct ContentEncoding for the endpoint enclosed in that pushSubscription.

If a service supports both encodings, aes128gcm should be prefered.

If anyone has insights into this, please comment on this issue.

Current data:

Google: aes128gcm

Microsoft: aes128gcm

Apple:

Mozilla: aes128gcm

KaiOS: aesgcm

Dygear commented 1 year ago

Mozilla Firefox 111.0.1 on Linux supports aes128gcm. Apple Safari Version 16.3 (18614.4.6.1.6) on macOS supports aes128gcm. Apple Safari Version 16.4 on iOS only returns aesgcm. That's painful.

Dygear commented 1 year ago

Looks like I was wrong. Safari on iOS does support aes128gcm. If anyone knows how to setup dev tools so web can inspect web apps that would be helpful as right now I can't see the console for the running web apps.

Dygear commented 1 year ago

I have successfully sent a push to the iPhone using iOS 16.4 using aes128gcm.

andyblarblar commented 1 year ago

I have successfully sent a push to the iPhone using iOS 16.4 using aes128gcm.

Excellent! Was there anything different required compared to other browsers? If not we can close #40

Dygear commented 1 year ago

Not really no. But I am straight up ignoring all of the other kinds of encoding and only trying aes128gcm. #40 can be closed as well.