majkinetor / au

Chocolatey Automatic Package Updater Module
GNU General Public License v2.0
227 stars 71 forks source link

TLS1.3 issue with update-package.ps1 on Server 2019 #238

Closed teknowledgist closed 3 years ago

teknowledgist commented 3 years ago

update.ps1 works great on my Win10 systems, but recently I have a need to update packages on a Server 2019 system, and every time, I get an error message:

Exception setting "SecurityProtocol": "Cannot convert value "Tls,Tls11,Tls12,Tls13" to type
"System.Net.SecurityProtocolType". Error: "Unable to match the identifier name Tls,Tls11,Tls12,Tls13 to a valid
enumerator name. Specify one of the following enumerator names and try again:
SystemDefault, Ssl3, Tls, Tls11, Tls12""
At C:\Program Files\WindowsPowerShell\Modules\au\Public\Update-Package.ps1:386 char:5

If I run that line, [System.Net.ServicePointManager]::SecurityProtocol = 'Tls,Tls11,Tls12,Tls13' by itself, I get the same error, but if I modify it: [System.Net.ServicePointManager]::SecurityProtocol = 'Tls,Tls11,Tls12', it works just fine.

I have not been able to find any information on how to enable TLS1.3 in Server 2019. If someone else can, could a link to that information be included in the documentation for AU?

Maybe AU could check what protocols are supported before setting what it will use? Something like:

$TLSes = ([enum]::GetNames([Net.SecurityProtocolType]) | ? {$_ -match 'tls'} ) -join ','
[System.Net.ServicePointManager]::SecurityProtocol = $TLSes

Thanks.

majkinetor commented 3 years ago

OMG ! Not again :)

Au actually does that:

https://github.com/majkinetor/au/blob/cdde93c7ffd0b69a8fc258e391eb6398a0a54d18/AU/Public/Update-Package.ps1#L385-L393

Do you use latest master version ? Can't remember if this is published... :S

teknowledgist commented 3 years ago

Ha! I guess I'm trying to reinvent what's already been fixed.

Well, kinda fixed. The latest AU Chocolatey package version (which I'm using) does not have that fix, and I'd prefer to upgrade that way than via git. Any idea when the next release will come out?

Thanks.

majkinetor commented 3 years ago

I don't know... couple of weeks to months. Working on test package sandbox feature as time permits so I will publish when it is done.

You should probably go manual in this case.

teknowledgist commented 3 years ago

Understood. At least the fix is in place and will be available at some point. Thanks.

majkinetor commented 3 years ago

No problem, sorry for the delay.