bskinn / sphobjinv

Toolkit for manipulation and inspection of Sphinx objects.inv files
https://sphobjinv.readthedocs.io
MIT License
78 stars 7 forks source link

SSL verification false or set alternative path #248

Closed yungchidanielcho closed 3 months ago

yungchidanielcho commented 1 year ago

Is your feature request related to a problem? Please describe.

tried this command in terminal

sphobjinv suggest https://docs.sqlalchemy.org/ 'cascade' -su 50

returns

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>

certifi was installed in the environment

Describe the solution you'd like

sphobjinv suggest https://docs.sqlalchemy.org/ 'cascade' -su 50 --verify false

returns suggestion results.

Describe alternatives you've considered

sphobjinv find https://docs.sqlalchemy.org/ 

returns the link where the objects.inv is located and let the user download it manually. Then they can use the sphobjinv locally.

Additional context

bskinn commented 1 year ago

Thanks for the problem report & request!

First: so I know, what Python version are you using?

Second, can you provide the output of pip list?


Starting at the bottom first:

returns the link where the objects.inv is located and let the user download it manually.

If your SSL certificate verification is broken, then a different sphobjinv subcommand will break in the same way as sphobjinv suggest for any HTTPS URL. So, this doesn't help your situation.


sphobjinv suggest https://docs.sqlalchemy.org/ 'cascade' -su 50 --verify false

Can you try the following code in a REPL launched from the environment where sphobjinv is installed, to make sure that a --no-cert-verify option would actually solve your problem?

>>> import sphobjinv as soi
>>> import ssl
>>> soi.Inventory._sslcontext.check_hostname = False
>>> soi.Inventory._sslcontext.verify_mode = ssl.VerifyMode.CERT_NONE
>>> soi.Inventory(url="https://docs.sqlalchemy.org/objects.inv")
Inventory(project='SQLAlchemy', version='1.4', source_type=<SourceTypes.URL: 'url'>)

Thanks again!

bskinn commented 3 months ago

Given that this has been idle for over a year, I'm going to close it.

If this is still an active problem, please attempt the test commands I provided at the end of my prior comment and report how it goes. I'll gladly reopen.