-
Notifications
You must be signed in to change notification settings - Fork 301
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
🐛 Bug Report — Runtime APIs: Error: [unenv] crypto.X509Certificate is not implemented yet! #2720
🐛 Bug Report — Runtime APIs: Error: [unenv] crypto.X509Certificate is not implemented yet! #2720
Comments
it's because this code is outdated now that we have a native crypto implementation: https://github.com/unjs/unenv/blob/main/src/runtime/node/crypto/%24cloudflare.ts#L12-L41 related issue: #2097 more recent discussion on how to stay up to date: unjs/unenv#294 |
This will be fixed with the next release. |
Here is the error source: https://github.com/agisboye/app-store-server-api/blob/main/src/Decoding.ts#L47 So my question is, the X509 implemented by workerd seems to be completely unusable when using the decodeJWS function of /app-store-server-api. Did I make a mistake, or does the X509 implementation in workerd indeed throw an error when trying to get the public key with cert.publicKey? Below is my business code (for reproduction): const app_store_api = getAppStoreApi()
const res_subscription = await app_store_api.getSubscriptionStatuses(tid!)
const item = res_subscription.data[0].lastTransactions.find(item => item.originalTransactionId === tid)!
const res_transaction = await decodeTransaction(item.signedTransactionInfo) |
@1yasa the PR referenced above on cloudflare/workers-sdk will expose the workerd implentation for This should be released in wrangler 3.78.7 later today. Please note that you can test now by using the wrangler build in cloudflare/workers-sdk#6782 (comment) Once this is released we will close the issue "Runtime APIs: Error: [unenv] crypto.X509Certificate is not implemented yet!". If you still see problems, please open a distinct issue to make tracking easier. Thanks! |
Get. Thanks! |
Codes:
Error:
Crypto supports on workers doc:
Config:
So my question is, why does the official website state that it supports crypto.X509Certificate, and in the code, it can also print out that X509Certificate is an anonymous class, why does it report an error when used:
Error: [unenv] crypto.X509Certificate is not implemented yet!
Both local and deploy to the server.
I really need help with this; if Cloudflare can't use the X509Certificate, it will be very troublesome!
The text was updated successfully, but these errors were encountered: