HTTPSConnectionPool(host='HOST', port=3780): Max retries exceeded with url: /api/3 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')))
If i disable verification in request , the Error Turns into
Could not find a suitable TLS CA certificate bundle, invalid path: b'I00\n'
I cant find a good documentation in Rapid7 for authenticating, It just says use basic authentication.
Are you using an internal CA for your cert? It looks like you need to install the cert chain on the box you are running the script. But I can confirm that a Base64 encoded Basic auth header works.
Here is an example for getting all of the sites below. I would suggest using something like Postman to help work through the API. The snippet you have above doesn’t look to be the full code though so I can’t fully understand what may have went wrong.
Our API documentation for the Authentication portion says it needs basic auth of the base64 encoded form of “username:password”
You can use CLI or online converters to convert literally the phrase “username:password” to base64 and then attach it in as shown in my script. Postman and other tools usually do this step for you.
Also keep in mind that my script is also disabling the SSL verification. As @brandon_mcclure mentioned, you can install the cert chain on the box you’re running the script from so that you don’t need to bypass the security warnings.