cosmopolitan icon indicating copy to clipboard operation
cosmopolitan copied to clipboard

redbean: add tls socket lua binding

Open chamot1111 opened this issue 1 year ago • 1 comments

Add TLS module for Lua using mbedTLS

  • Implements TLS socket creation and management
  • Supports connection, read, write, and close ops
  • Handles memory safely with proper cleanup
  • Provides error handling and status reporting
  • Configurable SSL verification and timeouts

chamot1111 avatar Sep 04 '24 17:09 chamot1111

I add a reference to this fullmoon request - https://github.com/pkulchenko/fullmoon/issues/29#issuecomment-1826528990 that seems related to the exposure of more mbedtls endpoints (I don't know if this should belong to the tls module or somewhere else)

@pkulchenko listed the openssl APIs that we are currently missing in order to add automatic letsencrypt DNS-01 challenge like the one existing in the caddy web server.

it would be a great new redbean feature if the exposure of more mbedtls endpoints could make it possible to have automatic ssl certification embedded.

I copy them here for reference

capturex('openssl', ('genrsa', '-out', $_, KEY_SIZE)); capturex('openssl', ('rsa', '-text', '-in', $self->{domain}{account}, '-noout', '-modulus')); capturex('openssl', ('rsa', '-in', $self->{domain}{account}, '-pubout'))); capturex('openssl', ('dgst', '-sha256', '-binary', '-sign', $self->{domain}{account}, $stf->filename)) capturex('openssl', ('req', '-new', '-outform', 'DER', '-key', $self->{domain}{key}, '-config', $oct->filename, '-out', $self->{req}{csr}));

jeromew avatar Sep 09 '24 11:09 jeromew