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

easyrsa-tools.lib: renew: Provide support for OpenSSL 1.1.0 #1243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dev/easyrsa-tools.lib
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,14 @@ Cannot renew this certificate, a conflicting file exists:
die "Failed to create inline directoy."

# Extract certificate usage from old cert
ssl_cert_x509v3_eku "$crt_in" cert_type
if ! ssl_cert_x509v3_eku "$crt_in" cert_type; then
# On failure, try using openssl 1.1.0
cert_type=
openssl_v110=1
ssl_cert_x509v3_eku "$crt_in" cert_type || \
die "renew - ssl_cert_x509v3_eku openssl_v110 failed"
openssl_v110=
fi

# Use SAN from old cert ONLY
if grep 'X509v3 Subject Alternative Name' "$crt_in"; then
Expand Down
4 changes: 2 additions & 2 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ verify_ssl_lib() {
# Run once only
[ "$verify_ssl_lib_ok" ] && return
verify_ssl_lib_ok=1
unset -v openssl_v3
unset -v openssl_v3 openssl_v110

# redirect std-err, ignore missing ssl/openssl.cnf
val="$(
Expand Down Expand Up @@ -4145,7 +4145,7 @@ ssl_cert_x509v3_eku() {
unset -v __known

# Extract certificate Extended Key Usage
if [ "$ssl_lib" = libressl ]; then
if [ "$ssl_lib" = libressl ] || [ "$openssl_v110" ]; then
__eku="$(
"$EASYRSA_OPENSSL" x509 -in "${__crt}" -noout -text | \
sed -n "/${__pattern}/{n;s/^ *//g;p;}"
Expand Down