Repository navigation
windowsservercore: urllib SSL errors #359
Description
Activity
I've verified that this is indeed an issue, but I've no idea where to turn to figure out what's going on. 😞
Thanks for checking. Yeah, information about this seems sparse.
One workaround (for users) would be to pip install certifi and set the SSL_CERT_FILE env var to the contained cacert.pem
As another data point, whether the error drops seems to depend on the site you're trying to hit; for example, doing
urllib.request.urlopen("https://bootstrap.pypa.io/get-pip.py"), I do not get an error. 🤷♂️I have the same issue, maybe this whould be forwarded to the Python people?
- Has anyone been able to reproduce outside the minimal Docker environment Microsoft provides? The most likely culprit is something the image is missing that a normal install isn't. (I'm not aware of anyone having filed anything upstream yet, but it's worth a search before doing so.)
Well I have the issue also with mcr.microsoft.com/windows which is not so minimal anymore. Not sure what else to test.
I'll have a look and file a bug on the Python tracker.
- Reacted by Tianon Gravi
As a (limited) workaround, maybe this can be added to the images:
certutil -generateSSTFromWU roots.sst && certutil -addstore -f root roots.sst && del roots.sst
But this really needs to be fixed in Python...
Looks like the latest on this is in
https://bugs.python.org/issue36011python/cpython#80192 (and that it's still a problem 😞).I just tested this fresh, just to be certain, and it's definitely still an issue on the latest builds. 🙈
ServerCore seems to come with significantly fewer root authority (Only 2 compared to the dozen on my Windows host.
It seems the certificates are managed either by Windows Update or by Active Directory policy.
To install them in the container you can run the following Powershell script
certutil.exe -generateSSTFromWU .\rootcerts.sst $sstFile = (Get-ChildItem -Path .\rootcerts.sst) $sstFile | Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root
Reacted by Edgar and filip-coherence
I can't get SSL to work in the container, any ideas welcome: