nlmatics / llmsherpa

Developer APIs to Accelerate LLM Projects
https://www.nlmatics.com
MIT License
1.37k stars 134 forks source link

Connection Error #46

Open JackOfAllSkills opened 8 months ago

JackOfAllSkills commented 8 months ago

I am using latest LLLSherpa to chunk a pdf but I always get this SSLCertVerificationError. I am using python 3.12 and using simple code llmsherpa_api_url = "https://readers.llmsherpa.com/api/document/developer/parseDocument?renderFormat=all" pdf_reader = LayoutPDFReader(llmsherpa_api_url) doc = pdf_reader.read_pdf(pdf_url). Looks like it is a known issue and could have been resolved by disabling SSL check but I could not find anyway to handle it as connections are made by LayoutPDFReader with no handle to disable SSL check. Please guide me.

Error Details: SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

MaxRetryError: HTTPSConnectionPool(host='readers.llmsherpa.com', port=443): Max retries exceeded with url: /api/document/developer/parseDocument?renderFormat=all (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)')))

JackOfAllSkills commented 8 months ago

I did below and it worked: 1- browse on Mac to Applications > Python 3.11 2- double click on “Install Certificates.command”

aj-in commented 5 months ago

This worked for me as well. thanks 1- browse on Mac to Applications > Python 3.11 2- double click on “Install Certificates.command”

Luchao2012 commented 5 months ago

Here is how I solved this issue in windows system, using VSCode, and created virtue env using miniconda conda activate your_env_name conda install certifi conda update certifi import os import certifi

os.environ['SSL_CERT_FILE'] = certifi.where()