I am currently trying to make an HTTP/2 request to a server.
I realize that when using HTTP/2 my request fails. (From server I get 'Unsupported')
python-requests doesn't support HTTP/2 so I used a wrapper build around requests called HTTPX which does support HTTP/2.
r = httpx.Client(http2=True)
data = '{"username":"'+username+'","password":"'+password+'","client_id":"someclientid","ux_id":"com.nike.commerce.snkrs.ios","grant_type":"password"}'
response = r.post('https://unite.nike.com/login', headers=self.login_header, params=params, data=data)
My requests doesn't error out, but I get "Unsupported" from server. I am trying to make request to Nike public login backend endpoint, I understand they have bot detections like akamai etc. I am under the impression that it uses special certificate these are the steps I did then
- Went to chrome browser.
- Click "Certificate" certificate Then I click "details" detailspage
Then I hit export export DER encoded binary x.509 (CER)
Assuming I am doing everything correctly, then I convert .cer to .pem
openssl x509 -inform der -in exported_certificate.cer -out certificate.pem
I then specify
export SSL_CERT_FILE='certificate.pem'
When I make the request again, I get the following error:
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
Ultimately, this is the client request I am trying to replicate
Request I am trying to achieve
According to screenshot my ios device is making a request with cipher name TLS_AES_256_GCM_SH384
, uses TLSv1.3