Hi all,
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:
print(i)
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?
Thanks!
I was able to get this to work following these steps:
Specify the certificate store per:
This included:
1) Installed “certifi”
2) Added this to my .bash_profile:
CERT_PATH=$(python3.8 -m certifi)
export SSL_CERT_FILE=${CERT_PATH}
export REQUESTS_CA_BUNDLE=${CERT_PATH}
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
Yes, it is great that you can solve the issue, but if in the future you face the error issue, you can refer to the following guide:- https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python/.
I hope it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error occurs while running the code on a Mac and still getting the "SSL: CERTIFICATE_VERIFY_FAILED." It can occur when making HTTPS requests using the requests module in Python. I can refer to the following helpful guide: https://cheapsslweb.com/blog/ssl-certificate-verify-failed-error-in-python/. Maybe it will help to solve the error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i tried downgrading the urllib3 to 1.24.1 and it worked for me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Have you try verify_ssl=False ?
Bitbucket(url='https://<ourURL>',token = '<myToken>', verify_ssl=False)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian,
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!
--Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I found the param to use in the code of the library you are using.
https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/rest_client.py#L45
Documentation is here also
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Aha, thanks for that! Unfortunately I don't see a way to disable the warnings to get this to work with the verify_ssl=False flag.
I've tried multiple solutions to the SSL certificate problem (such as running "Install Certificates.command"), but so far nothing has worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.