Commit 536f5f44 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

curl: use 2TLS by default

Make this the default for the curl tool (if built with HTTP/2 powers
enabled) unless a specific HTTP version is requested on the command
line.

This should allow more users to get HTTP/2 powers without having to
change anything.
parent 4bcc532d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -956,9 +956,11 @@ static CURLcode operate_do(struct GlobalConfig *global,
          /* new in libcurl 7.5 */
          my_setopt(curl, CURLOPT_MAXREDIRS, config->maxredirs);

          /* new in libcurl 7.9.1 */
          if(config->httpversion)
            my_setopt_enum(curl, CURLOPT_HTTP_VERSION, config->httpversion);
          else if(curlinfo->features & CURL_VERSION_HTTP2) {
            my_setopt_enum(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
          }

          /* new in libcurl 7.10.6 (default is Basic) */
          if(config->authtype)
+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ const NameValue setopt_nv_CURL_HTTP_VERSION[] = {
  NV(CURL_HTTP_VERSION_NONE),
  NV(CURL_HTTP_VERSION_1_0),
  NV(CURL_HTTP_VERSION_1_1),
  NV(CURL_HTTP_VERSION_2_0),
  NV(CURL_HTTP_VERSION_2TLS),
  NVEND,
};

+3 −2
Original line number Diff line number Diff line
@@ -46,10 +46,11 @@ Accept: */*
</protocol>
<stripfile>
s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
# configurations - just ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
$_ = '' if /CURLOPT_HTTP_VERSION/
</stripfile>
<file name="log/test1400.c" mode="text">
/********* Sample code generated by the curl command line tool **********
+3 −2
Original line number Diff line number Diff line
@@ -53,10 +53,11 @@ X-Men: cyclops, iceman

</protocol>
<stripfile>
# CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
# configurations - just ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
$_ = '' if /CURLOPT_HTTP_VERSION/
</stripfile>
<file name="log/test1401.c" mode="text">
/********* Sample code generated by the curl command line tool **********
+3 −2
Original line number Diff line number Diff line
@@ -51,10 +51,11 @@ foo=bar&baz=quux
<stripfile>
# curl's default user-agent varies with version, libraries etc.
s/(USERAGENT, \")[^\"]+/${1}stripped/
# CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
# ignore them
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
# configurations - just ignore them
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
$_ = '' if /CURLOPT_HTTP_VERSION/
</stripfile>
<file name="log/test1402.c" mode="text">
/********* Sample code generated by the curl command line tool **********
Loading