Getting ssl validation errors inside microK8s pod

Hi, I have a simple python docker image. If I run the docker image outside microK8s and run pip install, I have no problems. But, if I create a pod from the same docker image and run pip install from inside the pod, I get the following errors.

WARNING: Certificate did not match expected hostname: pypi.org. Certificate: {'subject': ((('commonName', 'it.domain.name'),),), 'issuer': ((('countryName', 'US'),), (('organizationName', "Let's Encrypt"),), (('commonName', 'R3'),)), 'version': 3, 'serialNumber': '03722F6A83D16B7C4CFF2BF8BBE520D3853B', 'notBefore': 'Mar 14 15:18:58 2021 GMT', 'notAfter': 'Jun 12 15:18:58 2021 GMT', 'subjectAltName': (('DNS', 'it.domain.name'),), 'OCSP': ('http://r3.o.lencr.org',), 'caIssuers': ('http://r3.i.lencr.org/',)}

I’m not able to figure out why. Any help would be much appreciated.