Icinga PowerShell REST Api - Event code 1500?

Hello,

I’m trying to setup the REST api for the Icinga Powershell framework but can’t seem to be able to connect to it due to an error which shows up in the event logs (event 1500):


A client connection could not be established to this server. This issue is mostly caused by using Self-Signed/Icinga 2 Agent certificates for the server and the client not trusting the certificate. To resolve this issue, either use trusted certificates signed by your trusted CA or setup the client to accept untrusted certificates

Object dumps if available:


Available           : 0
LocalEndPoint       : 127.0.0.1:5668
RemoteEndPoint      : 127.0.0.1:51284
Handle              : 1624
Blocking            : True
UseOnlyOverlappedIO : False
Connected           : True
AddressFamily       : InterNetwork
SocketType          : Stream
ProtocolType        : Tcp
IsBound             : True
ExclusiveAddressUse : False
ReceiveBufferSize   : 65536
SendBufferSize      : 65536
ReceiveTimeout      : 0
SendTimeout         : 0
LingerState         : System.Net.Sockets.LingerOption
NoDelay             : False
Ttl                 : 128
DontFragment        : True
MulticastLoopback   : 
EnableBroadcast     : 
DualMode            : 

I’ve generated a self-signed certificate using this Powershell command:



   PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\MY

Thumbprint                                Subject
----------                                -------
E46B8F5C430AEDD0618CC0D28BD499EDD47A6036  CN=test.example

And then configured the background daemon with these parameters:
PS C:\WINDOWS\system32> Register-IcingaBackgroundDaemon -Command 'Start-IcingaWindowsRESTApi' -Arguments @{ '-Port' = 5669; '-CertThumbprint' = 'E46B8F5C430AEDD0618CC0D28BD499EDD47A6036' };

I am getting PR_END_OF_FILE_ERRORs when trying to connect using Firefox and the following error when trying to use Powershell:

PS C:\WINDOWS\system32> Invoke-WebRequest -Method GET -UseBasicParsing -Uri 'https://localhost:5668/v1/checker?command=cpu';
Invoke-WebRequest : Unable to connect to the remote server
At line:1 char:1
+ Invoke-WebRequest -Method GET -UseBasicParsing -Uri 'https://localhos ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

I think the error message doesn’t really describe the issue, as the browser isn’t complaining about validation issues. Has anybody else run into this issue?