Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update perlang-install to detect tls1.2 for curl 7.73+ #185

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

perlun
Copy link
Collaborator

@perlun perlun commented Apr 16, 2021

As can be seen in the perlang-install sceencast at https://perlang.org/download/, certain versions of cURL fails in terms of the TLS 1.2 detection. This is the error we emit in these cases:

Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure
Warning: Not enforcing TLS v1.2, this is potentially less secure                                                                                                                 

The root cause for this is that the curl --help syntax has changed in recent versions (and ideally, parsing the curl --help output isn't a particularly great way anyway, but there's probably not much we can do about that). This commit, originally done by @apnorton in rust-lang/rustup#2604 (thanks!) fixes the issue. Given that perlang-install is essentially a fork of rustup-init.sh, the patch applied cleanly after merely editing the file name.

(After importing the commit, I did change the author of the commit to myself, since it would be a bit misleading to just copy commits from another author in another repo into this repo without their consent; it just looked weird that way.)

Original commit message

(from rust-lang/rustup@01fd3a1)

This fixes rust-lang/rustup#2603. In curl 7.73.0, the help format was
changed so as to only show a summary when calling curl --help, while
the old menu can be accessed as curl --help all. This change updates
the check_help_for function to detect if the command being checked
contains the curl 7.73.0+ language indicating the use of --help all.

If this language is present, check_help_for will insert the all
category after the --help flag, allowing the query to work. If the
language is not present, then it will insert an empty string following
the --help flag, maintaining the same behavior with pre-7.73 versions
of curl.

@perlun perlun added bug Something isn't working as expected installer The perlang-install script labels Apr 16, 2021
@perlun perlun added this to the 0.1.0 milestone Apr 16, 2021
(Original commit message from
rust-lang/rustup@01fd3a1#diff-a8a8a5affa9439c6617ca7b2cf8cb43e31b9a7706cc600852dd9c557dd8a00d0
below)

This fixes rust-lang/rustup#2603.  In curl 7.73.0, the help format was
changed so as to only show a summary when calling `curl --help`, while
the old menu can be accessed as `curl --help all`.  This change updates
the `check_help_for` function to detect if the command being checked
contains the curl 7.73.0+ language indicating the use of `--help all`.

If this language is present, `check_help_for` will insert the `all`
category after the `--help` flag, allowing the query to work.  If the
language is not present, then it will insert an empty string following
the `--help` flag, maintaining the same behavior with pre-7.73 versions
of curl.
@perlun perlun force-pushed the fix/perlang-install-rust-tls-detection branch from 1dac3b4 to cb8b1cb Compare April 16, 2021 19:30
@perlun perlun merged commit 839e736 into master Apr 16, 2021
@perlun perlun deleted the fix/perlang-install-rust-tls-detection branch April 16, 2021 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected installer The perlang-install script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installer detection of TLS 1.2 support fails for curl 7.73.0+
1 participant