最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - SSL error with zammad-py however curl works - Stack Overflow

programmeradmin0浏览0评论

The access to my zammad system works with curl. The following request results in a correct answer:

curl -H "Authorization: Token token=<user-token>" https://<url>/api/v1/users

However, the equivalent Python implementation zammad_py don't work.

from zammad_py import ZammadAPI

client = ZammadAPI(url=HOST, http_token=api_token)

# Example: Access all users
this_page = client.user.all()
for user in this_page:
    print(user)

The previous python code results in an ssl-error.

requests.exceptions.SSLError: HTTPSConnectionPool(host=<url>, port=443): Max retries exceeded with url: /users/me (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)')))

In addition, curl -v https://<url> shows no errors or warnings.

Does anyone have an idea?

The access to my zammad system works with curl. The following request results in a correct answer:

curl -H "Authorization: Token token=<user-token>" https://<url>/api/v1/users

However, the equivalent Python implementation zammad_py don't work.

from zammad_py import ZammadAPI

client = ZammadAPI(url=HOST, http_token=api_token)

# Example: Access all users
this_page = client.user.all()
for user in this_page:
    print(user)

The previous python code results in an ssl-error.

requests.exceptions.SSLError: HTTPSConnectionPool(host=<url>, port=443): Max retries exceeded with url: /users/me (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)')))

In addition, curl -v https://<url> shows no errors or warnings.

Does anyone have an idea?

Share Improve this question asked Nov 20, 2024 at 11:17 Thomas KThomas K 7611 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I found the solution, zammad-py does not support ssl so far. However, I added an SSLAdapter to the zammad-py code and now it works. I created also an issue (enter link description here) for this improvement.

发布评论

评论列表(0)

  1. 暂无评论