Running PoshBot on Windows Server 2016 Standard with POSH version 5.1, an error like below is recorded whenever get-xkcd is run.
Invoke-RestMethod http://xkcd.com/info.0.json
Invoke-RestMethod : The request was aborted: Could not create SSL/TLS secure channel.
At line:1 char:1
A secure connection should be establish, however the there seems to be an incompatibility with the default security protocol used by powershell versus the server.
Possible Solution
Putting the following at the top of PoshBot.XKCD.psm1 appears to fix the issue:
Current Behavior
Running PoshBot on Windows Server 2016 Standard with POSH version 5.1, an error like below is recorded whenever get-xkcd is run. Invoke-RestMethod http://xkcd.com/info.0.json Invoke-RestMethod : The request was aborted: Could not create SSL/TLS secure channel. At line:1 char:1
Expected Behavior
A secure connection should be establish, however the there seems to be an incompatibility with the default security protocol used by powershell versus the server.
Possible Solution
Putting the following at the top of PoshBot.XKCD.psm1 appears to fix the issue:
Steps to Reproduce (for bugs)
Context
With out the fix applied above, I could not enjoy the PoshBot.KCD plugin due to lack of comics loading. This post was helpful in understanding the problem and fix: http://blogs.perficient.com/microsoft/2016/04/tsl-1-2-and-net-support/
Your Environment