在Azure注册模型时遇‘certificate verify failed’错误求助
SSL Error When Registering New Model in Azure ML Workspace (No Code Changes)
Today I ran into an unexpected SSL error while registering a new model in my Azure ML workspace. The only change made was the model itself—my code hasn't been modified at all.
Here's the code I'm using to register the model:
from azureml.core import Workspace from azureml.core.compute import AksCompute, ComputeTarget from azureml.core.webservice import Webservice, AksWebservice from azureml.core.image import Image from azureml.core.model import Model import azureml.core from azureml.core.workspace import Workspace from azureml.core.model import Model ws = Workspace.from_config() model_reg = Model.register(model_path = "./outputs/model_final", model_name = "ModelX", tags = {'area': "XXX", 'type': "deep"}, description = "Model 1", workspace = ws)
The error traceback I'm getting is:
raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='xxx .blob.core.windows.net', port=443): Max retries exceeded with url: /azureml/LocalUpload/190530T093046-fc5a89ca/tfModel.tar.gz?sv=2018-03-28&sr=b&sig=9FFnsaefR9wPkR%2FvsMlnQYrA2wlnJG7Cu%2BP9%2FePPZEY%3D&st=2019-05-30T08%3A20%3A46Z&se=2019-05-31T08%3A30%3A46Z&sp=rcw&comp=block&blockid=TURBd01EQXdNREF3TURBd01EQXdNREF3TURBd01EQXdNREF3TURBd01EQSUzRA%3D%3D (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))
I've already tried updating all Python packages and creating a brand-new Conda environment with fresh dependencies, but the issue persists. If anyone has dealt with this before or has potential solutions, I'd really appreciate the help!
Potential Solutions to Try:
- Update System SSL Certificates: Often, this error stems from outdated root CA certificates on your local machine. On Linux, run
sudo apt update && sudo apt install --reinstall ca-certificates(Debian/Ubuntu) or the equivalent for your distro. On Windows, use the Certificate Manager to check for expired certificates and update trusted root authorities. - Temporarily Disable SSL Verification (Test Only!): For debugging purposes, you can disable SSL validation in your requests session. Never do this in production as it exposes you to security risks. Add this at the start of your code:
import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) requests.Session().verify = False - Check Network Proxy Settings: If you're on a corporate network, a proxy might be intercepting HTTPS traffic and presenting an untrusted certificate. Try switching to a direct network connection, or configure your proxy settings to trust Azure's Blob Storage certificates.
- Verify Azure Service Status: Occasionally, Azure services might have temporary certificate issues. Check Azure's official status updates to confirm that Azure Blob Storage is operating normally in your region.
内容的提问来源于stack exchange,提问作者Mohammad
相关产品推荐
相关产品推荐

