mirror of
https://github.com/proxmoxer/proxmoxer.git
synced 2026-04-25 07:06:00 +03:00
[GH-ISSUE #65] SSL error when using API Token authentication #34
Labels
No labels
backend:https
backend:local
backend:openssh
backend:ssh_paramiko
pull-request
status:ansible-issue
status:help-wanted
status:info-needed
status:proxmox-issue
status:review-needed
type:bug 🐞
type:dependency ⛓️
type:docs 📝
type:enhancement ⏫
type:maintenance 🛠️
type:meta
type:question ❓
type:request ✋
type:testing 🧪
version:1.x
version:latest
version:py2
version:py3
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmoxer#34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @therealscienta on GitHub (Sep 3, 2021).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/65
I get the following errors when trying to use API Token authentication. The token is generated as root without privilege separation. The same error shows when using password authentication and ssl_verify=True, but not when False. The SSL cert is Proxmox default.
Running Python 3.9.5
proxmoxer 1.1.1
requests 2.26.0
requests-toolbelt 0.9.1
paramiko 2.7.2
The code I run:
The error:
@jhollowe commented on GitHub (Sep 7, 2021):
In that code, you are missing
verify_ssl=Falsein your ProxmoxAPI() call. You will also need to add the realm (for root it is probably pam, soroot@pam) to the user for it to properly authenticate.I used the below code (after creating the "testtoken" API token under the "root@pam" user) and it successfully printed the node information.
If this solved your issue, please close the issue; if you have further questions, please ask!
@therealscienta commented on GitHub (Sep 8, 2021):
Oh, I'm sorry. Of course I did try verify_ssl=False (and root@pam) and get the same result.
requests.exceptions.SSLError: HTTPSConnectionPool(host='10.10.3.2', port=8006): Max retries exceeded with url: /api2/json/nodes (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))If reading the source code correcly, it does not use that parameter at all:
@jhollowe commented on GitHub (Sep 9, 2021):
In your example, you still have
verify_ssl=Truewhich will cause the given error if you are using the self-signed cert that comes default with PVE.And the
verify_sslis used in the session and not the individual auth. If you look in the Backend class, you will see where it sets up the session withverify_ssland selects the auth to use.@therealscienta commented on GitHub (Sep 9, 2021):
Yep, now it works. Maybe leave the coding when feeling under the weather...
Thank you for your help and thank you for this nice lib!