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

Robust cert file handling #133

Open
lwsystems opened this issue Oct 9, 2023 · 0 comments
Open

Robust cert file handling #133

lwsystems opened this issue Oct 9, 2023 · 0 comments

Comments

@lwsystems
Copy link

lwsystems commented Oct 9, 2023

The format of the cert file given with parameter -f is a little bit strict and must be

^<hostname><whitespace><blank>[<blank>,]<portnum>$

If one paste hostname and/or port, a blank could be added by mistake before the end of line or DOS line endings with ( could be added. In this situations, the call of ssl-cert-check will be fail with weird errors.
It would be useful, ssl-cert-check cleans the line before parsing like this:

--- ssl-cert-check 2023-10-09 17:52:21.955896376 +0200
+++ ssl-cert-check.robust 2023-10-09 17:52:35.595892084 +0200
@@ -917,6 +917,7 @@
IFS=$'\n'
for LINE in $(grep -E -v '(^#|^$)' "${SERVERFILE}")
do

  •    LINE=$(echo ${LINE}|${SED} -e 's/\t/ /g' -e 's/[\r ]\+$//g')
       HOST=${LINE%% *}
       PORT=${LINE##* }
       IFS=" "
    

Best regards,
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant