[Pki-users] Python programming against dogtag

Pascal Jakobi pascal.jakobi at gmail.com
Mon Jun 29 22:29:32 UTC 2020


I created the following python test script.

    import requests

    import json

    url = "https://zbook.home:8443/ca/rest/agent/certrequests"

    headers = {'Accept': 'application/json'}

    certfile='/etc/pki/tls/certs/ca_admin_cert.crt.pem'

    keyfile='/etc/pki/tls/private/ca_admin_cert.key.pem'

    r = requests.request("GET", url, headers=headers, verify=False,
    cert=(certfile,keyfile))

    print('DEBUG {}'.format(r.status_code))

    print('DEBUG {}'.format(r.json()))

It works fine against dogtag. However, it will fail if verify is set to 
True.

So how can I enable SSL verification ? In other terms, what's the 
equivalent to the "-k" switch from curl ?

Thanks in advance

-- 
*Pascal Jakobi*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pki-users/attachments/20200630/46f899ab/attachment.htm>


More information about the Pki-users mailing list