Icinga / icinga-powershell-framework

This PowerShell module will allow to fetch data from Windows hosts and use them for inventory and monitoring solutions. Together with the Icinga Web 2 module, a detailed overview of your Windows infrastructure will be drawn.
MIT License
78 stars 33 forks source link

Install-IcingaFrameworkPlugins: Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel. #55

Closed weust1979 closed 4 years ago

weust1979 commented 4 years ago

On Windows Server 2012 (non-R2) running PS 5.1 I get the following error message after executing Install-IcingaFrameworkPlugins (ran after Install-Module icinga-powershell-plugins and Use-Icinga).

PS C:\Windows\system32> Install-IcingaFrameworkPlugins Do you provide a custom repository for "Icinga Plugins"? (y/N): Which version to you want to install? (snapshot/stable) (Default: "stable"): Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel. At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\lib\core\framework\Get-IcingaPowerShellModule Archive.psm1:18 char:35

  • ... tRelease = (Invoke-WebRequest -Uri 'https://github.com/Icinga/icinga- ...
  • 
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
    eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

You cannot call a method on a null-valued expression. At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\lib\core\framework\Get-IcingaPowerShellModule Archive.psm1:19 char:17

  • ... $DownloadUrl = $LatestRelease.Replace('/releases/tag/', ...
  • 
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Downloading "Icinga Plugins" into "C:\Users\tweustink\AppData\Local\Temp\tmp_icinga477767759.d" Failed to download "Icinga Plugins" into "C:\Users\tweustink\AppData\Local\Temp\tmp_icinga477767759.d". Starting cleanup process Starting to re-run the download wizard Do you provide a custom repository for "Icinga Plugins"? (y/N): PS C:\Windows\system32> PS C:\Windows\system32> get-hsot get-hsot : The term 'get-hsot' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • get-hsot
  • 
    + CategoryInfo          : ObjectNotFound: (get-hsot:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

As far as I know Invoke-Webrequest can handle SSL/TLS. I use it in a couple of my own scripts running on the server.

LordHepipud commented 4 years ago

This is weird. What happens if you try the following:

Invoke-WebRequest -Uri 'https://github.com' -UseBasicParsing;

A second test would be this:

[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11";
Invoke-WebRequest -Uri 'https://github.com' -UseBasicParsing;

Does any of these requests work? Is it possible that you have a proxy between GitHub and your machine?

weust1979 commented 4 years ago

The second one works, the first one shows the same error as before.

No proxy is used. Just NAT.

LordHepipud commented 4 years ago

Could you please test the latest version of the PowerShell Framework for this? This issue should be - as far as I can tell - be fixed in #41

weust1979 commented 4 years ago

Install-Module -Name icinga-powershell-plugins works fine. Seperate server, even had to install NuGet Provider (the command asked to install it for me). Thanks!