XRAY: Resolving SSL Error in jf docker scan for JAS
Introduction
Sometimes, when running On-Demand Docker image scan on Xray with JAS, by executing CLI
command jf docker scan minio/minio:latest, an error occurs, returning the following terminal message:
[🚨Error] [Thread 0] failed to run Applicability scan. Exit code received: exit status 51
Additionally, three log files are generated for this scan:
1. ~/.jfrog/logs/jfrog-cli.<date>.log
- This log file does not show any errors.
2. ~/.jfrog/logs/analyzerManagerLogs/AnalyzerManagerLogFile_sec_<date>
- This log file does not show any errors.
3. ~/.jfrog/logs/analyzerManagerLogs/AnalyzerManagerLogFile_ca_<date>
requests.exceptions.SSLError: HTTPSConnectionPool(host='test.jfrogchina.com', port=443): Max retries exceeded with url: /xray/api/v1/internal/cve_applicability_input_vulnerabilities (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1007)')))
Root Cause
The SSL error occurs because the jas_scanner uses Python’s requests library, which defaults to verifying SSL certificates. The self-signed certificate for test.jfrogchina.com is not included in the default trusted CA certificates, resulting in a failed verification.
Resolution To bypass the SSL error, set the REQUESTS_CA_BUNDLE environment variable to point to the CA certificate bundle that includes the self-signed certificate:1. Retrieve the certificate and save it:$ openssl s_client -connect test.jfrogchina.com:443 -showcerts < /dev/null > /usr/local/share/ca-certificates/test.jfrogchina.com.crt
2. Update the CA certificates:$ update-ca-certificates
3. Export the updated CA bundle path:$ export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
After setting up the environment variable, rerun the command:
$ jf docker scan minio/minio:latest
The scan should be completed successfully without SSL verification issues.
[🔵Info] Scan completed successfully.