Why curl gets a 403 while a browser gets a 200: TLS fingerprinting explained
A developer found that a PHP script was blocked by one site despite identical URLs, headers, and cookies, with the real cause being the TLS handshake rather than HTTP headers. The ClientHello message, including cipher order, curves, and extensions, forms a JA3/JA4 fingerprint that generic clients like curl and PHP's OpenSSL bindings cannot easily alter. To work around this, the author built NativeHttp, a PHP client that assembles TLS 1.3 handshakes byte by byte with a Chrome-like profile and implements HTTP/2 on top. The hardest part was certificate verification, since PHP lacks support for RSA-PSS signatures, so the author implemented EMSA-PSS by hand to avoid accepting man-in-the-middle certificates. The library is available via Composer and requires no external dependencies.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in