How to deal with certificates? #12
-
I am currently developing small API to get data from GitHub to consume on my website (this will be cached etc.). I have the code at https://github.com/jsterlibs/jster-cf-api . Since I'm using a GitHub app, it's relying on a pem file for authentication. Effectively I followed the approach from https://github.com/gr2m/cloudflare-worker-github-app-example and I was able to get this to work by first generating a certificate and then splitting it into three chunks to load through the env. The question is, do you know a better way of doing this? Does Cloudflare have a better way of dealing with pem files or is this the best that can be done? I wonder if it's something you could build into Denoflare although I expect it's bit of a niche use case. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Cloudflare has excellent Web Crypto support, as do the most recents versions of Deno, so you should be able to do this just fine in a worker and in Denoflare. Use importKey to load the pem etc, I've done it in another project of mine called Minipub, feel free to steal the code. A few things to note:
|
Beta Was this translation helpful? Give feedback.
Cloudflare has excellent Web Crypto support, as do the most recents versions of Deno, so you should be able to do this just fine in a worker and in Denoflare. Use importKey to load the pem etc, I've done it in another project of mine called Minipub, feel free to steal the code.
A few things to note:
"secret"
instead of"value"
in denoflare config)