stratos icon indicating copy to clipboard operation
stratos copied to clipboard

jetstream: support generating TLS cert

Open mook-as opened this issue 4 years ago • 1 comments

Description

Add support to generate a self-signed TLS certificate for localhost, so that it can be used in situations where running the openssl command is difficult / inappropriate.

Motivation and Context

I want to try distributing Stratos to users (similar to the electron proof of concept); in this case, shipping a pre-generated certificate wouldn't make sense, because it would mean it would expire in a year or two. Since the golang standard library has good support for x509 anyway, it seemed easier to write the code to handle that on startup.

Node.js doesn't have the equivalent, and most of the packages there to do cert generation actually shell out to the openssl executable. Additionally, pulling in a dependency for this seemed unwise.

How Has This Been Tested?

  • Ran stratos using the new code, checking that it generated an acceptable certificate.
  • New test added. This may be excessive?

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] Docs update
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have followed the guidelines in CONTRIBUTING.md, including the required formatting of the commit message

I didn't see anywhere that would be obvious for new documentation; there didn't seem to be anywhere that listed the possible options.

mook-as avatar Mar 04 '21 17:03 mook-as

CLA Signed

The committers are authorized under a signed CLA.

  • :white_check_mark: Mark Yen (6c3ee1b202b4d7caee30203f461ed71d40d96210)