Skip to content

[Net.ServicePointManager]::SecurityProtocol is Globally Modified by the Module #230

Closed
@X-Guardian

Description

@X-Guardian

Issue Details

The [Net.ServicePointManager]::SecurityProtocol setting is getting globally modified by the execution of any resource function within the module.

Steps to reproduce the issue

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::SystemDefault
Write-Host ("Original SecurityProtocol value: " + [Net.ServicePointManager]::SecurityProtocol)
Get-GitHubRepository -OwnerName Microsoft -RepositoryName PowerShellForGitHub | Out-Null
Write-Host ("New SecurityProtocol value: " + [Net.ServicePointManager]::SecurityProtocol)

Verbose logs showing the problem

Original SecurityProtocol value: SystemDefault
New SecurityProtocol value: Tls12

Suggested solution to the issue

Modify the GitHubCore module and save/restore the value of the [Net.ServicePointManager]::SecurityProtocol property.

Requested Assignment

  • I'm just reporting this problem, but don't want to fix it.

Operating System

OsName               : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : 64-bit
WindowsVersion       : 1903
WindowsBuildLabEx    : 18362.1.amd64fre.19h1_release.190318-1202
OsLanguage           : en-GB
OsMuiLanguages       : {en-GB, en-US, th-TH}

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.0.1
PSEdition                      Core
GitCommitId                    7.0.1
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module Version

Running: 0.14.0
Installed: 0.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    in progressWork on this issue is already underway. Please don't work start new work on it.triage neededAn issue that needs to be reviewed by a member of the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions