Compare commits

..

2 Commits

Author SHA1 Message Date
6ccdec2764 added 'der' encoding recognize 2024-06-19 18:44:34 +03:00
f046396eb4 fixed links 2024-06-19 18:39:13 +03:00
2 changed files with 10 additions and 6 deletions

View File

@ -2,11 +2,11 @@
Small tools needed to solve immediate tasks independently or as part of a project
* [`build-python`.sh](https://git.hmp.today/pavel.muhortov/utils#build-python-sh)
* [`cert-info`.sh](https://git.hmp.today/pavel.muhortov/utils#cert-info-sh)
* [`ds18b20-over-ssh`.sh](https://git.hmp.today/pavel.muhortov/utils#ds18b20-over-ssh-sh)
* [`sendmail`.py](https://git.hmp.today/pavel.muhortov/utils#sendmail-py)
* [`simplewc`.py](https://git.hmp.today/pavel.muhortov/utils#simplewc-py)
* [`build-python`.sh](https://git.hmp.today/pavel.muhortov/utils#build-pythonsh)
* [`cert-info`.sh](https://git.hmp.today/pavel.muhortov/utils#cert-infosh)
* [`ds18b20-over-ssh`.sh](https://git.hmp.today/pavel.muhortov/utils#ds18b20-over-sshsh)
* [`sendmail`.py](https://git.hmp.today/pavel.muhortov/utils#sendmailpy)
* [`simplewc`.py](https://git.hmp.today/pavel.muhortov/utils#simplewcpy)
____

View File

@ -35,7 +35,11 @@ if [ -n "${certdest}" ]; then
certpath="$(printf "%s" "${certdest}" | cut -d':' -f1)"
if [ -f "${certpath}" ]; then
certdata=$(cat "${certpath}")
if grep -q 'BEGIN CERTIFICATE' "${certpath}"; then
certdata=$(openssl x509 -inform pem -in "${certpath}")
else
certdata=$(openssl x509 -inform der -in "${certpath}")
fi
else
certport="$(printf "%s" "${certdest}" | cut -d':' -f2 -s)"