While trying to generate a certificate for awx-operator using the following:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ansible-awx.pfs.lan.key -out ansible-awx.pfs.lan.crt -subj “/CN=ansible-awx.pfs.lan/O=ansible-awx.pfs.lan” -addext “subjectAltName = DNS:ansible-awx.pfs.lan”

** returns error: unknown option -addext

openssl version

OpenSSL 1.0.2k-fips 26 Jan 2017
** Why is OpenSSL dated Jan 2017 on Centos-7

yum info openssl

———————————————————————————————————
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base: mirror.wdc2.us.leaseweb.net
extras: mirror.mia11.us.leaseweb.net
updates: mirror.fcix.net
Installed Packages
Name : openssl
Arch : x86_64
Epoch : 1
Version : 1.0.2k
Release : 25.el7_9
Size : 814 k
Repo : installed
From repo : updates
Summary : Utilities from the general purpose cryptography library with TLS implementation
URL : http://www.openssl.org/
License : OpenSSL
Description : The OpenSSL toolkit provides support for secure communications between
: machines. OpenSSL includes a certificate management tool and shared
: libraries which provide various cryptographic algorithms and
: protocols.

yum group install “Development Tools”

yum install man-pages

gcc –version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
cd /usr/src
wget https://www.openssl.org/source/openssl-3.0.0.tar.gz
tar -zxf openssl-3.0.0.tar.gz
rm openssl-3.0.0.tar.gz
cd /usr/src/openssl-3.0.0
./config
make
make test
make install
ln -s /usr/local/lib64/libssl.so.3 /usr/lib64/libssl.so.3
ln -s /usr/local/lib64/libcrypto.so.3 /usr/lib64/libcrypto.so.3
openssl version
Even After ‘make install’ version reports:

FIX:

openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017 ** OLD VERSION **
# Find ‘old’ openssl path and move:
which openssl
/usr/bin/openssl
mv /usr/bin/openssl /usr/bin/openssl-
# Create link to new openssl:
ln -s /usr/local/bin/openssl /usr/bin/openssl
openssl version
OpenSSL 3.0.0 7 sep 2021 (Library: OpenSSL 3.0.0 7 sep 2021)

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ansible-awx.pfs.lan.key -out ansible-awx.pfs.lan.crt -subj “/CN=ansible-awx.pfs.lan/O=ansible-awx.pfs.lan” -addext “subjectAltName = DNS:ansible-awx.pfs.lan”

-rw-r–r–. 1 root root 1265 Mar 13 15:59 ansible-awx.pfs.lan.crt
-rw——-. 1 root root 1704 Mar 13 15:59 ansible-awx.pfs.lan.key
-rw-r–r–. 1 root root 120 Mar 13 14:37 awx-test-secret.yml