PyAuthenNTLM2 icon indicating copy to clipboard operation
PyAuthenNTLM2 copied to clipboard

(solved) [Errno 13] Permission denied

Open fartwhif opened this issue 7 years ago • 0 comments

CentOS 7 Apache/2.4.6 (CentOS) mod_python/3.5.0-e9fc930 Python/2.7.5

Problem:

 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)

fartwhif avatar Jun 14 '18 14:06 fartwhif