Skip to content

There seems to be an issue with the configuration priority of environment variables #1404

Closed

Description

@cuutt
Image

In the EasyRSA-Advanced.md document, it says that EasyRSA gives higher priority to environment variables over the vars file. However, even after I set the environment variables, it still used the configurations from the vars file.

Activity

  1. TinCanTech commented on Nov 5, 2025

    @TinCanTech
    Collaborator

    Which version of easyrsa is that and on what OS ?

  2. cuutt commented on Nov 5, 2025

    @cuutt
    Author

    这是哪个版本easyrsa,运行在哪个操作系统上?

    Alpine Linux 3.22
    EasyRSA 3.2.4

  3. TinCanTech commented on Nov 5, 2025

    @TinCanTech
    Collaborator
    tct@wiscii:~/git/easy-rsa/test/installed/test D$ echo $EASYRSA_CERT_EXPIRE
    10
    tct@wiscii:~/git/easy-rsa/test/installed/test D$ easyrsa --nopass build-client-full c3p0
    Using Easy-RSA 'vars' configuration:
    * /home/tct/git/easy-rsa/test/installed/test D/pki/vars
    Generating a ED448 private key
    writing new private key to '/home/tct/git/easy-rsa/test/installed/test D/pki/e5e768de/temp.02'
    -----
    
    Notice
    ------
    Private-Key and Public-Certificate-Request files created.
    Your files are:
    * req: /home/tct/git/easy-rsa/test/installed/test D/pki/reqs/c3p0.req
    * key: /home/tct/git/easy-rsa/test/installed/test D/pki/private/c3p0.key
    
    You are about to sign the following certificate:
    
      Requested CN:     'c3p0'
      Requested type:   'client'
      Valid for:        '10' days
    
    
    subject=
        commonName                = c3p0
    

    Works for me ..

  4. cuutt commented on Nov 6, 2025

    @cuutt
    Author

    Does your vars file have the EASYRSA_CERT_EXPIRE configuration enabled? Based on my testing, if this option is configured in the vars file, it will always use the value from there; only when it’s commented out will the environment variable setting take effect.

  5. TinCanTech commented on Nov 6, 2025

    @TinCanTech
    Collaborator

    So, you are saying that, your vars file is resetting an externally set variable ?

  6. cuutt commented on Nov 6, 2025

    @cuutt
    Author

    yes

  7. TinCanTech commented on Nov 6, 2025

    @TinCanTech
    Collaborator

    Your vars file is not supported, take a look at vars.example in the source.

  8. cuutt commented on Nov 6, 2025

    @cuutt
    Author

    It really was a problem with the format of the vars file — I didn’t expect it to still work.

  9. cuutt commented on Nov 6, 2025

    @cuutt
    Author

    Thank you very much for your answer.

  10. TinCanTech commented on Nov 6, 2025

    @TinCanTech
    Collaborator

    Closed-as: archived.

    This looks like a glitch in the main-frame: #1404 (comment)

  11. TinCanTech commented on Nov 8, 2025

    @TinCanTech
    Collaborator

    source_vars() could grep for set_var.

  12. linked a pull request that will close this issueUpdate EasyRSA-Advanced.md #1403on Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions