2

When running sam build --use-containers to create an AWS python 3.8 lambda function that uses a downloaded library, I am getting an error:

pip._vendor.requests.exceptions.SSLError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/d0/32/6c367f54699bd51961cf3e10299f6dee976f0f6813210052a4d8c2bd1d2b/pymemcache-3.2.0-py2.py3-none-any.whl (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not yet valid (_ssl.c:1108)')))

I checked the certificate on https://files.pythonhosted.org, and the cert is marked as starting on 7/13/2020. it's currently 7/14/2020.

I see that I can set the trusted hosts option to hopefully avoid this, (similar to: pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"), but when PIP is being run from within a container via a script Im not sure how to set it.

if looks like I can use an environment variable to set the PIP trusted hosts as well, but I am not sure how to set that in the docker image used by SAM

(running on a windows 10 system)

Dan Strohl
  • 23
  • 6
  • hows it going today? – petey Jul 16 '20 at 22:26
  • still having the same problem. – Dan Strohl Jul 17 '20 at 22:02
  • from the lack of responses, I'm assuming that I'm the only one with this issue. – Dan Strohl Jul 17 '20 at 22:03
  • Seems like its a python problem within that docker instance, can you see if you can note/update the version of python its using? Also, I almost never use `--use-container`....takes way to long. – petey Jul 17 '20 at 22:58
  • Since I am using some libraries that require local compiling, I needed it (as far as I can tell). but... I added debug logging to the docker config and the problem went away. No idea why. it doesn't seem likely they are related, but hey, problem solved! – Dan Strohl Jul 17 '20 at 23:22
  • :) HAH! Sometimes thats how it goes. Lately, sam build hangs for me on building node lambdas, I just restart. Guess python's got the same issues. – petey Jul 17 '20 at 23:25
  • I’m voting to close this question because the user was attempting to use a newly created SSL certificate which had a starting datetime in the future. Once that datetime was in the past, things worked – petey Jul 29 '20 at 20:15

0 Answers0