I have been trying to access an API which is secured using SSL using python requests library as given below
requests.get('https://path/to/url',cert=('cert.pem','key.pem'),verify='ca.pem')
but am getting an error
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 385, in send
raise SSLError(e)
requests.exceptions.SSLError: hostname '10.10.10.10' doesn't match u'*' # IP address is not real.
If my understanding is right this certificates can be used with any server since they are signed with '*' as domain.
I guess the requests library is making a strict match of hostname verification instead of regular expression matching.
so my question is whether it is a bug with requests library or is this the way it is indented to work?
It is working perfectly fine when I use curl command as given below.
curl https://path/to/url --cert cert.pem --key key.pem --cacert ca.pem
So i have two possibilities, either curl library is not performing hostname verification or they are doing it with regular expression.
Where am i going wrong here? Expecting a detailed answer