PyAuthenNTLM2 is an authentication module for Apache. It validates a user by means of the NTLM protocol and a separate Domain Controller (or Active Directory server).
PYNTLM: Error when retrieving Type 2 message from server(192.168.64.1) = [Errno 13] Permission denied
PYNTLM: Exception: Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pyntlm.py", line 233, in connect_to_proxy
ntlm_challenge = proxy.negotiate(type1)
File "/usr/lib/python2.7/site-packages/PyAuthenNTLM2/ntlm_proxy.py", line 75, in negotiate
self._openConnection()
File "/usr/lib/python2.7/site-packages/PyAuthenNTLM2/ntlm_proxy.py", line 46, in _openConnection
self.socket.connect((self.ipaddress, self.port))
File "/usr/lib64/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 13] Permission denied
Solution:
run the following command as root
setsebool httpd_can_network_connect=1
selinux is enabled by default
Please add this to the troubleshooting checklist.
It might be a good idea to include this in various exception handling contexts. I had to do it to obtain the stack trace:
req.log_error('PYNTLM: Exception: %s' % (traceback.format_exc()), apache.APLOG_CRIT)
CentOS 7 Apache/2.4.6 (CentOS) mod_python/3.5.0-e9fc930 Python/2.7.5
Problem:
Solution:
run the following command as root
setsebool httpd_can_network_connect=1
selinux is enabled by default Please add this to the troubleshooting checklist.It might be a good idea to include this in various exception handling contexts. I had to do it to obtain the stack trace:
req.log_error('PYNTLM: Exception: %s' % (traceback.format_exc()), apache.APLOG_CRIT)