nginx / njs

A subset of JavaScript language to use in nginx
http://nginx.org/en/docs/njs/
BSD 2-Clause "Simplified" License
1.14k stars 149 forks source link

Add support for SSL certificate generation #766

Open osokin opened 2 months ago

osokin commented 2 months ago

Is your feature request related to a problem? Please describe

NJS API is able to generate keys, however it's impossible to generate SSL certificates.

Describe the solution you'd like

Extend the existing API with creation SSL certificates.

Describe alternatives you've considered

There's no alternative solutions available.

Additional context

There's no any other context or screenshots about the feature request is available at the moment.

gallarda commented 1 month ago

A use case for this feature request is when NGNIX needs to build a custom mTLS client certificate for authentication to upstreams.

jo-carter commented 4 days ago

@osokin @gallarda Did you investigate using https://www.npmjs.com/package/@peculiar/x509#set-crypto-provider-for-nodejs for this usecase?

I see it uses WebCrypto API, that is already supported in NJS.