I have apache 2.4 with SSL validating client certificates. I'm trying to filter some users by the CN provided in the client cert. For that, I wrote a file with a list of permitted CN, with one CN per line.
The expression need to be like: true if %{SSL_CLIENT_S_DN_CN}
is inside {file("/etc/httpd/users.txt")}
.
So, I want to use the "file" function to "Read contents from a file (including line endings, when present)" to validate the %{SSL_CLIENT_S_DN}
from client certificate.
I tested it with: %{} in {file()} and %{} =~ {file()}
, but it doesn't work.
I don't find any example on apache docs or googling. Does anyone knows how I can do this?