<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 15, 2017 at 1:24 PM, Andrei Ivanov <span dir="ltr"><<a href="mailto:andrei.ivanov@gmail.com" target="_blank">andrei.ivanov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Hi,<br></div>I'm trying to access the SSL_CLIENT_SAN_IPAddr variables that mod_nss should expose, from a Lua authorization script.<br></div>The problem is that it doesn't seem to work :-(<br><br></div>Following a suggestion from the users group, I used some RewriteRule to expose variables and some are visible, but the client SAN IP addresses are not:<br><br></div></div></div></div></div></div></blockquote><div><br></div><div>I've also tried with SSL_CLIENT_SAN_<wbr>IPaddr_0, as the source code seems to be using it, still no luck :-(<br></div><div>I've checked with SSL_CLIENT_SAN_Email_0 and that works, so it might be an IP address type issue (?)<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div>LuaScope thread<br>LuaAuthzProvider remote_ip_in_client_san /etc/httpd/authz/authz_check_<wbr>remote_ip_in_client_san.lua authz_check_remote_ip_in_<wbr>client_san<br>RewriteEngine On<br>RewriteRule .* - [E=sanip:%{SSL:SSL_CLIENT_SAN_<wbr>IPAddr_0}]<br>RewriteRule .* - [E=c_verify:%{SSL:SSL_CLIENT_<wbr>VERIFY}]<br>RewriteRule .* - [E=c_s_dn:%{SSL:SSL_CLIENT_S_<wbr>DN}]<br>RewriteRule .* - [E=ssl_ver_if:%{SSL:SSL_<wbr>VERSION_INTERFACE}]<br>RewriteRule .* - [E=ssl_ver_lib:%{SSL:SSL_<wbr>VERSION_LIBRARY}]<br><Location /><br>    Require remote_ip_in_client_san<br>    #NSSRequire %{REMOTE_ADDR} in %{SSL_CLIENT_SAN_IPaddr} <br>    #Require expr "%{REMOTE_ADDR} in %{SSL_CLIENT_SAN_IPaddr}" <br></Location><br><br></div>The generated log:<br>[Wed Feb 15 13:14:07.653866 2017] ssl ver if: mod_nss/1.0.14<br>[Wed Feb 15 13:14:07.653871 2017] ssl ver lib: NSS/3.21 Basic ECC<br>[Wed Feb 15 13:14:07.653876 2017] client verify: SUCCESS<br>[Wed Feb 15 13:14:07.653881 2017] client DN: CN=client-with-subjectAltName-<wbr>with-IPs<br>[Wed Feb 15 13:14:07.653886 2017] sanip: <br><br></div>Initially I hoped that mod_nss would expose all the SAN IP addresses as an array (SSL_CLIENT_SAN_IPAddr), but now I've read that it actually should create a variable for each, with a suffix (SSL_CLIENT_SAN_IPAddr_0), but that doesn't seem to be available either.<br><br></div>What am I doing wrong? <br></div>Please help.<br><br></div>Thank you.<br></div>
</blockquote></div><br></div></div>