You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I attempt to use the library on Python 3.12 I receive the following error:
Enter server IP address or hostname:192.168.12.5
Enter username: admin
Enter password:
Traceback (most recent call last):
File "c:\Users\brad\Documents\GitHub\nvdlib\nvdlib\nvdlib\tests\testapi.py", line 67, in <module>
main()
File "c:\Users\brad\Documents\GitHub\nvdlib\nvdlib\nvdlib\tests\testapi.py", line 41, in main
login_res = client.login(username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ n
File "C:\Program Files\Python312\Lib\site-packages\cpapi\mgmt_api.py", line 324, in api_ payload)call ^^^^^^^^^
conn = self.get_https_connection() mon_login_logic
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\cpapi\mgmt_api.py", line 771, in get_https_connection call
self.conn = self.create_https_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\cpapi\mgmt_api.py", line 765, in creahttps_connectionte_https_connection
conn.connect()
File "C:\Program Files\Python312\Lib\site-packages\cpapi\mgmt_api.py", line 787, in connte_https_connectionect
self.sock = ssl.wrap_socket(self.sock, self.key_file, self.cert_file, cert_reqs=ssl.CEectRT_NONE) RT_NONE)
^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'
Remove the ssl.wrap_socket() function, deprecated in Python 3.7: instead, create a ssl.SSLContext object and call its ssl.SSLContext.wrap_socket method. Any package that still uses ssl.wrap_socket() is broken and insecure. The function neither sends a SNI TLS extension nor validates server hostname. Code is subject to CWE-295: Improper Certificate Validation. (Contributed by Victor Stinner in gh-94199.)
The text was updated successfully, but these errors were encountered:
I think this can be worked around by editing mgmt_api.py line 787 of the library. I am not familiar with the inner workings of this library or the SSL module to know if this is an appropriate change.
Hi,
When I attempt to use the library on Python 3.12 I receive the following error:
I believe this is due to
ssl.wrap_socket
being deprecated in favor ofssl.SSLContext.wrap_socket
as stated in the What's New for Python 3.12: https://docs.python.org/3.12/whatsnew/3.12.html#sslThe text was updated successfully, but these errors were encountered: