Why does curl use HTTP / 1.1 and not HTTP / 2 on a Mac?

According to this https://curl.haxx.se/docs/http2.html

Since 7.47.0, the curl tool enables HTTP/2 by default for HTTPS connections.

Installing the latest version using homebrew and checking:

curl --version
curl 7.54.1 (x86_64-apple-darwin15.6.0) libcurl/7.54.1 SecureTransport zlib/1.2.5

but running curlthe URL with HTTP2 support (e.g. using https://tools.keycdn.com/http2-test ), I get:

curl -I http://www.google.co.uk 
HTTP/1.1 200 OK

and

curl --http2 -v http://www.google.co.uk
curl: (1) Unsupported protocol

Any idea why it uses HTTP / 1.1 and not HTTP / 2?

+4
source share
2 answers

You can create curl to use one of many different TLS / SSL libraries, each of which has slightly different sets of functions and offers slightly different conditions for curl to work.

, SecureTransport TLS, , - TOS macOS.

Secure Transport curl HTTP/2 TLS - , , , , ALPN, curl HTTP/2 TLS .

TLS, curl HTTP/2, nghttp2, , curl HTTP/2, . nghttp2 curl HTTP/2 HTTP, TLS ALPN.

?

macOS curl libreSSL HTTP/2.

curl TLS, OpenSSL, GnuTLS NSS, HTTP/2 HTTPS.

+8

MacOS Sierra , HTTP2, OpenSSL SecureTransport.

  • brew reinstall curl --with-openssl --with-nghttp2
  • brew link curl --force
  • curl -V - :

curl 7.54.1 (x86_64-apple-darwin16.6.0) libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.8 nghttp2/1.24.0 : 2017-06-14 : dict ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp : IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy

, MacOS curl. , brew link curl --force , , HTTP- homebrew.

+2

Source: https://habr.com/ru/post/1680787/


All Articles