Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.py does not support netbox url with self-signed certificates #147

Closed
strus38 opened this issue Jul 4, 2020 · 5 comments
Closed

Comments

@strus38
Copy link
Contributor

strus38 commented Jul 4, 2020

Hi
could you update config.py, so it can work with self-signed certificates?
Proposal:

  • add an option to netbox-agent: --ignore-ssl-verify

Modifications (in addition of adding the option):

  • in config.py line line 1
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

then line 80:

if (no_ssl_verify):
    session = requests.Session()
    session.verify = False

nb = pynetbox.api(
     url=get_config().netbox.url,
     token=get_config().netbox.token
)
if (no_ssl_verify):
    nb.http_session = session
return nb

Thanks!

@Solvik
Copy link
Owner

Solvik commented Jul 7, 2020

If you're able to propose a PR and test it, that would be very nice :)

@strus38
Copy link
Contributor Author

strus38 commented Jul 8, 2020

The PR 152 is opened. Feel free to merge or comment it.
Thanks!

@Solvik
Copy link
Owner

Solvik commented Jul 8, 2020

many thanks for this addition !

@strus38
Copy link
Contributor Author

strus38 commented Jul 8, 2020

Don't know how to fix the flake8 error. I let you fix it for me if you can.

@Solvik
Copy link
Owner

Solvik commented Jul 11, 2020

#152 merged!

@Solvik Solvik closed this as completed Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants