Here's the thing , I have been trying to send POST request to LOGIN to my college wifi page from within python but I am getting SSL certicate error . The POST request works fine from POSTMAN extention of chrome.
Here is how the request looks like when I use the chrome'e debugger to see the POST requests
Request URL:https://112.133.253.2:8090/login.xml
Request Method:POST
Status Code:200 OK
Remote Address:112.133.253.2:8090
Referrer Policy:no-referrer-when-downgrade
POST /login.xml HTTP/1.1
Host: 112.133.253.2:8090
Connection: keep-alive
Content-Length: 72
Origin: https://112.133.253.2:8090
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept: */*
Referer: https://112.133.253.2:8090/httpclient.html
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
I found that the Problem was in specifying 'http' in the post request url , which should have been https
.
When I use https
however , I get the python's SSL certificate error .
I have tried giving verify=False
parameter with no luck . I have also tried giving path to certificate like this :-
resp = S.post("https://112.133.253.2:8090/login.xml" ,
data = data ,
verify = "/etc/ssl/certs/ca-certificates.crt") ;
But nothing works .
How is the extension of postman working without giving SSL certificate errors ? How can I fix this issue to send the requests from Python itself ?