Forums

web2py ProxyError Forbidden 403

Hello, I'm trying to test pagseguro module, wich tries to connect to ws.pagseguro.uol.com.br

For some reason, it is returning this error:

class 'requests.exceptions.ProxyError' Cannot connect to proxy. Socket error: Tunnel connection failed: 403 Forbidden.

Traceback (most recent call last):

File "/home/JuliaRizza/web2py/gluon/restricted.py", line 227, in restricted

exec ccode in environment

File "/home/JuliaRizza/web2py/applications/courses_app/controllers/payments.py", line 343, in <module>

File "/home/JuliaRizza/web2py/gluon/globals.py", line 412, in <lambda>

self._caller = lambda f: f()

File "/home/JuliaRizza/web2py/gluon/tools.py", line 3583, in f

return action(*a, **b)

File "/home/JuliaRizza/web2py/applications/courses_app/controllers/payments.py", line 154, in pagseguro

payment_response = pg.checkout()

File "/home/JuliaRizza/web2py/site-packages/pagseguro/init.py", line 225, in checkout

response = self.post(url=self.config.CHECKOUT_URL)

File "/home/JuliaRizza/web2py/site-packages/pagseguro/init.py", line 219, in post

return requests.post(url, data=self.data, headers=self.config.HEADERS)

File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 88, in post

return request('post', url, data=data, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 44, in request

return session.request(method=method, url=url, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 383, in request

resp = self.send(prep, **send_kwargs)

File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 486, in send

r = adapter.send(request, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 385, in send

raise ProxyError(e)

ProxyError: Cannot connect to proxy. Socket error: Tunnel connection failed: 403 Forbidden.

Can someone help me?

Free accounts can only access sites on the internet if they are in our whitelist. The list is published here We will add domains to the whitelist if they have a public API and we think that it will be generally useful to everyone. If you would like to add a site to the whitelist, send us the domain and a link to the API documentation.