TheHive-Project / TheHive-Project/Cortex-Analyzers
[Bug] [X509: NO_CERTIFICATE_OR_CRL_FOUND] no certificate or crl found
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 490
- Forks
- 405
- Avg merge
- 2d 43m
- Merged PRs (30d)
- 8
Description
Describe the bug
When trying any analyzers this errors pops-up :

/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py:1043: InsecureRequestWarning: Unverified HTTPS request is being made to host 'urlscan.io'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings warnings.warn(Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/urllib3/util/ssl_.py", line 402, in ssl_wrap_socket context.load_verify_locations(ca_certs, ca_cert_dir, ca_cert_data)ssl.SSLError: [X509: NO_CERTIFICATE_OR_CRL_FOUND] no certificate or crl found (_ssl.c:4262)During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 1040, in _validate_conn conn.connect() File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 416, in connect self.sock = ssl_wrap_socket( File "/usr/local/lib/python3.9/dist-packages/urllib3/util/ssl_.py", line 404, in ssl_wrap_socket raise SSLError(e)urllib3.exceptions.SSLError: [X509: NO_CERTIFICATE_OR_CRL_FOUND] no certificate or crl found (_ssl.c:4262)During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 440, in send resp = conn.urlopen( File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 785, in urlopen retries = retries.increment( File "/usr/local/lib/python3.9/dist-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause))urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='urlscan.io', port=443): Max retries exceeded with url: /api/v1/result/538c6a57-2167-4d77-921b-d7e54bc08203/ (Caused by SSLError(SSLError(136, '[X509: NO_CERTIFICATE_OR_CRL_FOUND] no certificate or crl found (_ssl.c:4262)')))During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/etc/cortex/analyzers/Urlscan.io/urlscan_analyzer.py", line 102, in <module> UrlscanAnalyzer().run() File "/etc/cortex/analyzers/Urlscan.io/urlscan_analyzer.py", line 42, in run 'indicator': self.scan(query) File "/etc/cortex/analyzers/Urlscan.io/urlscan_analyzer.py", line 30, in scan res = Urlscan(indicator).scan(self.api_key) File "/etc/cortex/analyzers/Urlscan.io/urlscan.py", line 38, in scan submission_req = requests.get(submission_url) File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 529, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 645, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 517, in send raise SSLError(e, request=request)requests.exceptions.SSLError: HTTPSConnectionPool(host='urlscan.io', port=443): Max retries exceeded with url: /api/v1/result/538c6a57-2167-4d77-921b-d7e54bc08203/ (Caused by SSLError(SSLError(136, '[X509: NO_CERTIFICATE_OR_CRL_FOUND] no certificate or crl found (_ssl.c:4262)')))
To Reproduce
Steps to reproduce the behavior:
- Install cortex via DEB package version 3.1.4-1
- Clone this repository, export and configure analyzers in application.conf
- After installing the requirements of some analyzers they all fail due to SSLError
Complementary information
URLHaus :

AbuseIPDB :

Which certificate is he failing to get ? How ?
'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)'))
Output of requests from the same server :
>>> import requests
>>> requests.get("https://urlscan.io")
<Response [200]>
This is beyond me i have tried the fix https://github.com/TheHive-Project/Cortex-Analyzers/issues/605 nothing changes.
Work environment
- Client OS: Debian 11
- Server OS: Debian 11
- Browse type and version:
- Cortex version: 3.1.4-1
- Cortex Analyzer/Responder name: All of them
Possible solutions
I have tried certifi adding each CA certs from my own store to a custom pem file and it's not working either. It looks like cortex cannot figure out to find a certificate to trust.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with /etc/cortex/analyzers/Urlscan.io/urlscan.py and urlscan_analyzer.py, then compare their requests behavior with the successful direct request shown in the report. Review the analyzer configuration in application.conf and the reported certificate settings. Done means the affected analyzers can perform their HTTPS requests on the stated Debian 11 setup without the reported certificate errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100