Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command write syntax details #1061

Closed
TinCanTech opened this issue Jan 9, 2024 · 0 comments · Fixed by #1055, #1165 or #1208
Closed

Command write syntax details #1061

TinCanTech opened this issue Jan 9, 2024 · 0 comments · Fixed by #1055, #1165 or #1208

Comments

@TinCanTech
Copy link
Collaborator

TinCanTech commented Jan 9, 2024

Introduction: Command write is essentially used internally to supply the required configuration files, on demand. Command write code is exposed for testing purposes.

Command write syntax:

  • easyrsa write <type> <filename> [overwrite]
    Does not over write an existing file, unless option overwrite is given.
  • easyrsa write <type> > "$your_file" - Redirect as necessary.
    Caution! Will over write an existing file.
  • easyrsa write <type> - Write type to stdout. Test this!

Command write does not require a PKI. It can be tested as-is.
Please, take care to not over write your current working files.

<type> is required, listed below:

  • ssl-cnf - Print default openssl-easyrsa.cnf.
  • safe-cnf - Print fully expanded safessl-easyrsa.cnf.
    Requires EASYRSA_TEMP_DIR to be an existing directory.
  • vars - Print default vars.example.
    pki/vars.example is always created at init-pki.
  • COMMON|ca|server|serverClient|client|codeSigning|email|kdc
    Print default x509-types file by name.

<filename> is optional:

  • If <filename> is specified then files are output to <filename>.
  • Existing files of the same name are always preserved, unless option overwrite is given.
  • safessl-easyrsa.cnf has never been an existing file, NEVER preserved.
  • Only type legacy-hard (See below) will over write existing files.

It is also suitable to redirect output as required:

  • easyrsa write <type> > $your-file - Destructive, use with caution.

There are also two composite types to write:

  • legacy - Create all pki/x509-types files and pki/openssl-easyrsa.cnf
  • legacy-hard - Create and OVERWRITE existing files, as legacy above.
  • Note: Both require a working PKI (init-pki) and cannot use file redirection.
@TinCanTech TinCanTech self-assigned this Jan 9, 2024
@TinCanTech TinCanTech added this to the v3.2.0 milestone Jan 9, 2024
@TinCanTech TinCanTech linked a pull request Jan 9, 2024 that will close this issue
@TinCanTech TinCanTech reopened this Jan 14, 2024
@TinCanTech TinCanTech pinned this issue Jan 17, 2024
@TinCanTech TinCanTech unpinned this issue Feb 4, 2024
@TinCanTech TinCanTech modified the milestone: v3.2.0 Mar 27, 2024
@TinCanTech TinCanTech linked a pull request Jun 16, 2024 that will close this issue
@TinCanTech TinCanTech linked a pull request Aug 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment