Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-3358

Invoke-WebRequest Powershell cmdlet Fails to Negotiate TLS with Compass Installer API

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Build, Compass, Installation
    • None
    • Not Needed

      The install_compass script on Windows is currently unable to download the Compass installer .exe. It appears unable to negotiate TLS for some reason. We can test the ultimate command that fails (see the attached screenshot as well):

      PS C:\Windows\system32> Invoke-WebRequest -Uri https://compass.mongodb.com/api/v2/download/latest/compass-community/stable/windows -OutFile foo.exe
      Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel.
      At line:1 char:1
      + Invoke-WebRequest -Uri https://compass.mongodb.com/api/v2/download/la ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
      
      PS C:\Windows\system32>
      

      The download does seem to work in the Firefox and Edge web browsers, but curl also seemed to fail in negotiating TLS.

      Perhaps the browsers are more lax... Did we make any recent changes to the TLS cert used for this API?

      It may be that we need to add some additional code to the script, but the script was working as-is AFAIK.

            Assignee:
            matt.lord Matt Lord (Inactive)
            Reporter:
            matt.lord Matt Lord (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: