{"id":1023,"hash":"9c2ecd162c4706638c86f08989ada88ea630312a52bd2b5bf5ab115c80cad9a3","pattern":"SSLError: HTTPSConnectionPool(host=&#39;huggingface.co&#39;, port=443): Max retries exceeded with url: /dslim/bert-base-NER/resolve/main/tokenizer_config.json","full_message":"I am facing below issue while loading the pretrained BERT model from HuggingFace due to SSL certificate error.\n\nError:\n\nSSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /dslim/bert-base-NER/resolve/main/tokenizer_config.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)')))\n\nThe line that is causing the issue is:\ntokenizer = AutoTokenizer.from_pretrained(\"dslim/bert-base-NER\")\n\nSource code:\nfrom transformers import AutoTokenizer, AutoModelForTokenClassification\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\ntokenizer = AutoTokenizer.from_pretrained(\"dslim/bert-base-NER\")\nmodel = AutoModelForTokenClassification.from_pretrained(\"dslim/bert-base-NER\")\n\nI am expecting to download pre-trained models while running the code in jupyter lab on Windows.","ecosystem":"pypi","package_name":"python-3.x","package_version":null,"solution":"A working solution to this is the following:\n\n1)\n\n pip install requests==2.27.1   \n\nPlease note that both prerequisites need to take place, just running the following code will not work unless you have that specific version of requests (I had to downgrade in my case from 2.29.0 to 2.27.1.\n\n2)\n\nimport os\nos.environ['CURL_CA_BUNDLE'] = ''","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/75110981/sslerror-httpsconnectionpoolhost-huggingface-co-port-443-max-retries-exce","votes":22,"created_at":"2026-04-19T04:52:12.290380+00:00","updated_at":"2026-04-19T04:52:12.290380+00:00"}