-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2651 Update to openpgp v6 #2653
Conversation
Hi @sosnovsky, I’ve completed migrating OpenPGP to v6. However, v6 heavily relies on the Web Crypto API, which doesn’t seem to be supported by the iOS WebView. This results in the following error caused by the line below:
Some suggest using a polyfill, others recommend implementing an iOS native bridge to handle crypto operations, and some propose reverting back to OpenPGP v5—which we’d prefer to avoid. Let me know your thoughts and suggestions. |
Browser compatibility table shows that most of |
Sure. Let me check |
From my research, it looks like we have two options(The Web Crypto API is only available in a secure context, so right now it’s undefined):
I tried registering a custom scheme handler, but iOS still doesn’t recognize it as secure. It might be best to set up a local HTTPS server, though we’ll need to consider certificates (maybe a self-signed one). I’ll dig more into this. Let me know your thoughts! |
Using https server seems to be more stable solution, but need to check if it's not complicated. |
I tried both Telegraph and Flyingfox (which doesn’t support TLS) to serve flowcrypt-ios-prod.js.txt over HTTP/HTTPS, but I still got the same error. |
I created a test application and loaded google.com into a WebView. Then, I inspected the WebView to check if the crypto.subtle API was available. However, even with this simple WebView displaying google.com, the crypto.subtle API is not accessible. Could it be that the WebCrypto API is not available in the WebView context? Or am I missing something? Could you jump in and take a look at this issue with me? |
ok, I think I'll be able to check it a bit later. |
Hi @ioanmo226, I tried to load https://google.com in our Core WKWebView and ![]() |
Hmm.. strange let me check again |
I tried with simple local http server and seems like openpgp code works fine in there too. |
Oh, I thought it'll work only with https server. Using http server should be much simpler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great 👍
This PR upgraded openpgp to v6
close #2651 // if this PR closes an issue
Tests (delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):