Trim CR-LF when parsing LINE from file #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current issue
Using a CR-LF encoded file and running
ssl-cert-check -f filenamecurrently results in invalid PORT parsing and later failingopensslcommandThe currently visible error is
but after some debuging I found out that
"${OPENSSL}" s_client $OPTIONS 2> "${ERROR_TMP}" 1> "${CERT_TMP}"fails withThis is due to
$OPTIONSbeing truncated as the$2variable inside it has a CR-LF char, so the command passed to openssl has invalid syntax.Here's what
$OPTIONSlook like with CR-LF input file :"-servername host.domain.local"the first half of the command is truncated (
"-connect ${1}:${2}")Fix
We can make the script compatible with CR-LF input files by removing
\rfrom the parsed line.some issues mention this error, I guess they were running the command against CR-LF input file.
Should not be a breaking change, I tried with CR-LF and LF encoded file, both works with this fix.