Skip to content

Invoke-Webrequest accepts bad TLS certificates / crypto on MacOS #1942

Closed

Description

Steps to reproduce

Trying to write a PowerShell stub for https://github.com/ouspg/trytls , I discovered
that PowerShell (running on MacOS 10.11.6) Invoke-Webrequests accepts some invalid
certificates. Additionally, it allows the use of RC4 cryptography, which is now considered insecure.

On Ubuntu 16.04 (after installing some libcurl dependencies), these are rejected.

https://github.com/wbond/badtls.io has additional tests that I could not run, since I could not
figure out how to use a custom CA bundle, these should be investigated as well.

Expected behavior

Invoke-Webrequest https://incomplete-chain.badssl.com/ should fail
Invoke-Webrequest https://rc4.badssl.com/ should fail

Actual behavior

Site loads without throwing exception

## Environment data

Name                           Value

---

PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.9
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Activity

  1. ppietikainen commented on Aug 19, 2016

    @ppietikainen
    Author

    Looks like it's Apple's SecureTransport behind all this. RC4 should get dropped in MacOS 10.12, accepting incomplete chains is a bit dubious, but allowed...

  2. added this to the milestone on Sep 29, 2016
  3. modified the milestones: , on Dec 19, 2016
  4. modified the milestones: 6.0.0-beta1, on Mar 16, 2017
  5. modified the milestones: , on May 15, 2017
  6. joeyaiello commented on May 24, 2017

    @joeyaiello
    Contributor

    Unfortunately, failure/success here is dictated by the underlying .NET calls (which I believe depend on the underlying platform crypto APIs).

    It might make sense for us to throw some warnings here, but given that we'd break a bunch of people by implementing new exceptions, I'm going to close this for now. If you disagree, feel free to reopen.

  7. added
    Resolution-By Design
    on May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-By DesignWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions