0

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

  1. Went to chrome browser.
  2. 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

HOOOPLA
  • 65
  • 3
  • 9

1 Answers1

1

I assume you have long solved the issue, but for other similar problems, a response from the server saying Unsupported possibly implies that the server does not support HTTP2.

For a petition to be able to be made through HTTP2 not only has the client have to be able to make it, but the server has to actively support HTTP2 as well, otherwise you might a response as the one above.

NicolasZ
  • 845
  • 4
  • 10
  • 26