I'm trying to connect to our internal Bitbucket server via the Atlassian Python API, using a token:
from atlassian import Bitbucket
bb = Bitbucket(url='https://<ourURL>',token = '<myToken>')
data = bb.project_list()
for i in data:
When I run the above code I get the error "SSL: CERTIFICATE_VERIFY_FAILED".
I'm running on a Mac, using IDLE.
I've tried adding a "verify=False" to the connection string, but then I get an error that the parameter "verify" isn't recognized.
I'm new to using APIs (and certificates) so I'm probably missing something basic here. Any ideas?
I was able to get this to work following these steps:
Specify the certificate store per:
1) Installed “certifi”
2) Added this to my .bash_profile:
CERT_PATH=$(python3.8 -m certifi)
3) Linked “ln -s” the cacert.pem file to the cert.pem file
Then I re-added the internal Certs for our repos to the cacert.pem file
This is much closer! Now I get a string of 30 warnings:
"InsecureRequestWarning: Unverified HTTPS request is being made to host...Adding certificate verification is strongly advised."
These are followed by:
"requests.exceptions.TooManyRedirects: Exceeded 30 redirects.".
Is there a way to disable warnings?
And how did you find the verify_ssl parameter? Is there documentation somewhere that I missed?
Thanks so much for the help!
I found the param to use in the code of the library you are using.
Documentation is here also
Usually it's ok to have warning, the "requests.exceptions.TooManyRedirects: Exceeded 30 redirects." is another error.
Can you try to add an header to your request following this recommandation
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events