netbox-netprod-importer icon indicating copy to clipboard operation
netbox-netprod-importer copied to clipboard

SSL ignore not working.

Open GangstaPirates opened this issue 5 years ago • 7 comments

Hey, Despite having disable_ssl_warnings set as True or False in the config I still get the following issue when trying to connect to netbox api.

ERROR: netbox_importer: Error when polling device HCC-S009-RT01: HTTPSConnectionPool(host='netboxtest.###.##', port=443): Max retries exceeded with url: /api/dcim/devices/?name=HCC-S009-RT01&limit=50 (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),))

GangstaPirates avatar Nov 25 '20 01:11 GangstaPirates

Same Issue, _disable_ssl_warning_s set to True is not being respected at import:

Version: 0.3.3 Python: 3.8.5 certifi: 2019.11.28 urllib3: 1.25.8

~/.config/netbox-netprod-importer/config.yml

netbox@netbox:/opt/netbox-netprod-importer$ cat ~/.config/netbox-netprod-importer/config.yml_bak 
#### Global options ####
########################

## Be more verbose ##
verbose: None

## Disable ssl warnings in urllib3 ##
disable_ssl_warnings: True


################
#### Netbox ####
################

netbox:
  # Netbox API URL
  url: "https://172.16.1.114/api"
  # username: "user"
  # password: "password"
  # or to use a token instead
  token: "********************"


##########################
#### Interconnections ####
##########################

# On some devices, LLDP will expose the host FQDN. If devices are stored on
# Netbox only by their hostname, the interconnection process will not be able
# to find them. Fill this list to strip the domain name from exposed names.
remove_domains:
  - "foo.tld"
  - "bar.tld"

# vim: set ts=2 sw=2:

command run:

netbox-netprod-importer import -f devices.yaml

Error:

ERROR: netbox_importer: Error when polling device XXXXX-INFRA-NUTSW1: HTTPSConnectionPool(host='172.16.1.114', port=443): Max retries exceeded with url: /api/dcim/devices/?name=XXXXX-INFRA-NUTSW1&limit=50 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

danjaf avatar Dec 16 '20 21:12 danjaf

Hi there, i'm getting facing the same issue: ERROR: netbox_importer: Error when polling device B-core-1: HTTPSConnectionPool(host='172.16.x.x', port=443): Max retries exceeded with url: /api/dcim/devices/?name=x-core-1&limit=50 (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))

urllib3 ver 1.26.2 any idea?

gratziano avatar Jan 02 '21 18:01 gratziano

Hi,

Had the same problem and was able to circumvent the issue by adding my CA certificate chain to

/opt/netbox/venv/lib/python3.6/site-packages/certifi/cacert.pem

This way urllib3 is able to verify the certificate.

ecoutinho avatar Mar 31 '21 14:03 ecoutinho

Hi,

Had the same problem and was able to circumvent the issue by adding my CA certificate chain to

/opt/netbox/venv/lib/python3.6/site-packages/certifi/cacert.pem

This way urllib3 is able to verify the certificate.

thanks for the hint, I tried that but it didn't work in my case. here is what I did to fix the issue:

  1. add the my CACERT to /usr/local/share/ca-certificates/CACERT
  2. run sudo update-ca-certificates
  3. make sure the CACERT is appended to file /etc/ssl/certs/ca-certificates.crt

this was fixed for now and I just got the issue #39 with netbox 2.9!

gratziano avatar Apr 09 '21 21:04 gratziano

Hello, All workarounds above didn't work for me. Appended my CA certificate to /venv/lib/python3.x/site-packages/ceftifi/cacert.pem and it resolved my issue.

Tolisan avatar Apr 29 '21 08:04 Tolisan

Hello, All workarounds above didn't work for me. Appended my CA certificate to /venv/lib/python3.x/site-packages/ceftifi/cacert.pem and it resolved my issue.

This also worked for me

haukened avatar Jun 01 '22 18:06 haukened

I have appendended my certs to cacert.pem file on windows, but still i am facing the same issue. can anyone suggest me

lasag-2511 avatar May 11 '23 14:05 lasag-2511