You can drop down to the HTTPSConnectionPool level which you may do directly:
from urllib3.connectionpool import HTTPSConnectionPool
conn = HTTPSConnectionPool('httpbin.org', ca_certs='/etc/pki/tls/cert.pem', cert_reqs='REQUIRED')
Or, more simply or via the connection_from_url() helper function:
conn = urllib3.connection_from_url('https://httpbin.org', ca_certs='/etc/pki/tls/cert.pem', cert_reqs='REQUIRED')
Note that ca_certs is the file name of a certificate bundle used to validate the remote server's certificate. Use cert_file and key_file to present your client certificate to the remote server:
conn = urllib3.connection_from_url('https://httpbin.org', cert_file='client-2048.crt', key_file='client-2048.key', ca_certs='/etc/pki/tls/cert.pem', cert_reqs='REQUIRED')
Then issue your request:
response = conn.request('POST', 'https://httpbin.org/post', fields={'field1':1234, 'field2':'blah'})
>>> print response.data
{
"args": {},
"data": "",
"files": {},
"form": {
"field1": "1234",
"field2": "blah"
},
"headers": {
"Accept-Encoding": "identity",
"Connection": "close",
"Content-Length": "220",
"Content-Type": "multipart/form-data; boundary=048b02ad15274fc485c2cb2b6a280034",
"Host": "httpbin.org",
"X-Request-Id": "92fbc1da-d83e-439c-9468-65d27492664f"
},
"json": null,
"origin": "220.233.14.203",
"url": "http://httpbin.org/post"
}