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

verify_working_env() is called too early for invalid commands #984

Closed
TinCanTech opened this issue Jul 17, 2023 · 0 comments · Fixed by #985
Closed

verify_working_env() is called too early for invalid commands #984

TinCanTech opened this issue Jul 17, 2023 · 0 comments · Fixed by #985

Comments

@TinCanTech
Copy link
Collaborator

EG:

$ easyrsa --pki-dir=ns --nopass bild-cat

WARNING
=======
No Easy-RSA 'vars' configuration file exists!

IMPORTANT:
  The preferred location for 'vars' is within the PKI folder.
  To silence this message move your 'vars' file to your PKI
  or declare your 'vars' file with option: --vars=<FILE>

WARNING
=======
install_data_to_pki - Missing: 'x509-types'

EasyRSA version ~VER~

Error
-----
Missing expected CA file: ca.crt

(perhaps you need to run build-ca?)

Run easyrsa without commands for usage and command help.

Simple but irritating fix, EG:

case "$cmd" in
	init-pki|clean-all)
		init_pki "$@"
		;;
	build-ca)
		# Do verify_working_env() AFTER the command is recognised
		verify_working_env

		[ -z "$alias_days" ] || \
			export EASYRSA_CA_EXPIRE="$alias_days"
		build_ca "$@"
		;;
@TinCanTech TinCanTech changed the title verify_working_env( is called too early for invalid commands verify_working_env() is called too early for invalid commands Jul 17, 2023
@TinCanTech TinCanTech added the BUG label Jul 17, 2023
@TinCanTech TinCanTech added this to the v3.1.6 milestone Jul 17, 2023
@TinCanTech TinCanTech linked a pull request Jul 17, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant