I am also facing the same problem if I try to connect to ambari REST service from Python as well. I have used all libraries provided by Python for making URL connection and all returned the same error for Ambari (but working for other services).
I came across “python-ambariclient” which is a python library available to connect to ambari. This also failed and returned the same error. I have tried this even in the Sandbox, but no luck!
Can some one please try executing a simple CURL command or python, to ambari REST and let us know here whether it is a common problem, or I am only facing the issue?
PS: I am able to access ambari REST service when using HttpUrlConnection from Java. Hence, the service available in general.