Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python post request with certificate

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

like image 875
MR.A Avatar asked Oct 22 '25 09:10

MR.A


1 Answers

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.

like image 136
Mammu yedukondalu Avatar answered Oct 24 '25 00:10

Mammu yedukondalu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!