I would like to store an HTTP request in a variable and then use it with OpenSSL
I now have
HTTP_REQUEST="HEAD / HTTP/1.1\\nHost: ${HOST_HEADER}\\nUser-Agent: check_ssl_cert/${VERSION}\\nConnection: close\\n\\n"
and then
echo -e '${HTTP_REQUEST}' | openssl s_client -connect ${HOST}:${PORT} ${SERVERNAME} -status 2> /dev/null | grep -A 17 'OCSP response:'
echo e
is not POSIX. Is there an alternative?
echo -e '${HTTP_REQUEST}'
would output the exact string${HTTP_REQUEST}
, as it's single quoted. – Kusalananda Jan 16 '19 at 16:21