chocolatey / cChoco

Community resource to manage Chocolatey
Apache License 2.0
154 stars 99 forks source link

cChocoInstaller - Use SSLv3 only for powershell 5 or lower versions #183

Open coderjoe opened 5 months ago

coderjoe commented 5 months ago

Description Of Changes

Update the cChocoInstaller to only use SSLv3 for versions lower than Powershell 6

Motivation and Context

SSLv3 was deprecated and removed in Powershell 6+ resulting in the resource throwing an error: Exception setting "SecurityProtocol": "The requested security protocol is not supported."

Omitting SSLv3 resolved this issue in Powershell 6 and 7 for my use cases.

Testing

  1. Manually tested in Powershell 7.4.1 and Powershell 5 on Windows Server 2019 Datacenter

Operating Systems Testing

Change Types Made

Change Checklist

Related Issue

Relates to #182 and possibly #173 Fixes #182

coderjoe commented 5 months ago

I'd like to add tests for this, but I believe this would require different appveyor setups using different powershell versions (5 or less, 6, and 7). It was not clear to me how to test across multiple powershell versions. I'm happy to update if I could get some guidance on how best to get that done.

Gijsreyn commented 5 months ago

Would love to see this Pull request get in. I'm facing the same issue, especially now I'm trying out the Guest Configuration.

Gijsreyn commented 5 months ago

@coderjoe just tested out your change locally.

You've to add the $securityProtocolSettingsOriginal = [System.Net.ServicePointManager]::SecurityProtocol to keep the original. Otherwise it throws an error :)

coderjoe commented 5 months ago

What a silly thing to miss. Thank you very much for the test @Gijsreyn! Had some local upstaged changes that somehow got missed in the first commit. I'll have to re-test Monday to make sure there isn't anything else I've missed. 👍

Gijsreyn commented 5 months ago

@coderjoe No worries champ. Was already glad you had an open pull request here with the fix :)

czechdude commented 1 month ago

Why does it take so long to merge? I would like to use it in Azure Policies Guest Configuration as well, but becasue of this, it is not possible.

Thanks!