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

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

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742362305a4429628.html

相关推荐

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

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

    2小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信