sol1 / icingaweb2-module-netbox

Netbox importer for director, and integration with netbox
28 stars 6 forks source link

Connecting to https url with a self-signed certificate #19

Closed iliasbarthelemy closed 1 year ago

iliasbarthelemy commented 1 year ago

Hello, I' trying to connect to my netbox instance using a a self signed certificate.

I'm getting the error: This Import Source failed when last checked at 2022-09-19 16:15:47: get https://netbox.xxxx.com/api/ipam/services/?status=active&limit=1000: status 0 SSL: unable to obtain common name from peer certificate

After some googling I added curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); to line 29 of Netbox.php

But now i'm getting the following error: This Import Source failed when last checked at 2022-09-19 16:18:29: get https://netbox.xxxxxxx.com/api/ipam/services/?status=active&limit=1000: status 403

Can anyone help me out ? The token and API url are correct.

Best regards

sol1-matt commented 1 year ago

403 is a auth error so it looks like you've fixed the first problem. For auth errors I'd check the following

If that doesn't work I'd look at testing netbox using curl on the command line. This helps prove Netbox is functioning and the switches used can help figuring out what is required to get it working.

iliasbarthelemy commented 1 year ago

Indeed, the problem was with Netbox.