Search code examples
pythonpython-2.7authenticationssljks

How to send https request with client certificate using Python programming language


I have two jks files truststore.jks and keystore.jks that I use when sending REST request with java based client , now I want to use Python but I didn't find a way to use them to authenticate so How can I use them in Python ?


Solution

  • You didn't provide much of info (e.g. what you tried before), so my answer will be not precise.

    I think what you are looking for is urllib2.urlopen() (probably using Request object to tune up request properties), note SSL-related function parameters. But first you'll probably need to convert jks files to format accepted by Python (I guess it's OpenSSL format).