Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert value "Tls,Tls1,Tls2" to type "System.Net.SecurityProtocol.Type" #1406

Closed
arizvisa opened this issue Jan 6, 2020 · 5 comments
Assignees

Comments

@arizvisa
Copy link
Contributor

arizvisa commented Jan 6, 2020

Description of Issue/Question

In salt-bootstrap.ps1, the System.Net.SecurityProtoclType::Tls1 and System.Net.SecurityProtoclType::Tls2 enumerations do not exist on .NET Framework 4.0. This means the following line of code at salt-bootstrap.ps1:102 has an undocumented dependency;

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12''

This results in the following error/backtrace:

Cannot convert value "Tls,Tls11,Tls12" to type "System.Net.SecurityProtocolType due to invalid enumeration values. Specify one of the following enumeration values and try again. The possible enumeration values are "Ssl3, Tls".
Downloading Salt minion installer Salt-Minion--AMD64-Setup.exe
At C:\Users\vagrant\AppData\Local\Temp\salt\bootstrap-salt.ps1:103 char:87
    + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType] <<<< 'Tls,Tls11,Tls12'
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

You could wrap it in an exception handler and assign the constants directly to remain independent of the available .NET framework versions.

System.Net.SecurityProtocolType.Ssl3 -- 48 -- 0x30
System.Net.SecurityProtocolType.Tls -- 192 -- 0xC0
System.Net.SecurityProtocolType.Tls11 -- 768 -- 0x300
System.Net.SecurityProtocolType.Tls12 -- 3072 -- 0xC00

Setup

Use .NET Framework 4.0

Steps to Reproduce Issue

Run salt-bootstrap.ps1

Versions and Systems

Salt-Bootstrap.ps1 doesn't have a version parameter, but the url it's being requested from is https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.ps1, and the latest commit is c252c74.

@arizvisa
Copy link
Contributor Author

arizvisa commented Jan 6, 2020

Ftr, this issue was actually introduced by the latest commit c252c74

@twangboy
Copy link
Contributor

What version of Windows are you running?

@twangboy
Copy link
Contributor

After investigating a little further, even if you set those constants directly, the version of .NET installed on Windows 7 by default still does not support them. Whether you set the text value (Tls12) or the flag value (0xC00). The only way to install using the bootstrap script is to upgrade .NET to a later version that supports Tls1.2. That's .NET 4.5 apparently.

@twangboy
Copy link
Contributor

Also this KB will apparently enable Tls12 on Windows 7: KB3154518

@arizvisa
Copy link
Contributor Author

In PR boxcutter/windows#201, we're explicitly patching out Tls12 to work around this issue and will probably end up linking to a previous commit if you guys choose to remove W7 out of your support matrix.

daxgames pushed a commit to daxgames/boxcutter_windows that referenced this issue Feb 26, 2020
arizvisa added a commit to arizvisa/boxcutter-windows that referenced this issue Jul 16, 2020
arizvisa added a commit to arizvisa/boxcutter-windows that referenced this issue Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants