Closed Faolain closed 2 months ago
As you stated, Bun does not appear to support X509Certificate at this time, which is part of the cryptographic verification process. As this is core cryptography to the process, we recommend using Node.js.
Fair enough @alexanderjordanbaker! I created a workaround with Bun I will edit this thread with. Thank you.
Making a new issue here in case the other gets buried as it's closed
https://github.com/apple/app-store-server-library-node/issues/173#issuecomment-2334604252
When I import the library for use within Bun and execute
I get the error:
I assume this has something to do with the crypto module however Bun I thought had support for node functions whether via
or
Although the export exists it is marked as "missing" here https://bun.sh/docs/runtime/nodejs-apis#node-crypto , and when I try the following:
I get the error: SyntaxError: Export named 'X509Certificate' not found in module 'crypto'. any thoughts on using a polyfill/library that doesn't depend on the node library itself and can bundle in support which doesn't call the node lib? A microservice? Forking to use node-forge replacing the "node native (but not supported elsewhere)" crypto package? Either that or should the transactions then be manually verified using JOSE/jsonwebtoken? If so can you provide an example of this?