Skip to content

Instantly share code, notes, and snippets.

@pantaluna
Created November 20, 2016 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pantaluna/8cfda856735e7c363cad01e9b7e5712f to your computer and use it in GitHub Desktop.
Save pantaluna/8cfda856735e7c363cad01e9b7e5712f to your computer and use it in GitHub Desktop.
Apache modsecurity_crs_10_setup.conf - Add HTTP/2.0 to the list of allowed http versions
# ***SPECIAL*** Add HTTP/2.0 to the list of allowed http versions
# Fixes the modsecurity error [id "960034"] [rev "2"] [msg "HTTP protocol version is not allowed by policy"] [data "HTTP/2.0"]
MYSCRIPT="/usr/share/modsecurity-crs/modsecurity_crs_10_setup.conf"
SEARCHTHIS="'tx.allowed_http_versions=HTTP/0.9 HTTP/1.0 HTTP/1.1'"
REPLACEWITH="'tx.allowed_http_versions=HTTP/0.9 HTTP/1.0 HTTP/1.1 HTTP/2.0'"
sed --in-place "s#${SEARCHTHIS}#${REPLACEWITH}#" ${MYSCRIPT}
grep --ignore-case "${REPLACEWITH}" ${MYSCRIPT} || echo "ERROR: the text has NOT been REPLACED!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment