how to send certificate authentication in python post request, for example I used next but in get request: requests.get(url, params = params, timeout=60,cert=certs) where certs is path to certificate, it's worked fine. requests.post(url_post,data=params,cert = certs, timeout=60) not working, error - SSL authentication error
Asked
Active
Viewed 9,723 times
4
-
Can you show some code? – oshaiken Jun 09 '17 at 14:58
-
requests.post(url_post,data=params,cert = certs, timeout=60) – MR.A Jun 12 '17 at 07:44
1 Answers
1
To send certificate, you need the certificate which contains public key like server.crt. If you have this crt file then you can send it as
r=requests.get('https://server.com', verify='server.crt' )
or if you don't have that file then you can get it using get_ssl_certificate method
ert=ssl.get_server_certificate(('server.com',443),ssl_version=3)
then you can write it into a file and send it.

Mammu yedukondalu
- 136
- 2
- 14