{"id":14063810,"url":"https://github.com/markekraus/BetterTls","last_synced_at":"2025-07-29T16:32:00.423Z","repository":{"id":44454034,"uuid":"126466587","full_name":"markekraus/BetterTls","owner":"markekraus","description":"PowerShell Module to Enable TLS 1.1 and 1.2 for Use in Windows PowerShell Where Neither are Enabled by Default","archived":false,"fork":false,"pushed_at":"2020-04-01T16:48:19.000Z","size":30,"stargazers_count":55,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-04T01:36:11.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markekraus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-23T10:00:24.000Z","updated_at":"2024-06-23T22:34:31.000Z","dependencies_parsed_at":"2022-08-28T22:01:26.498Z","dependency_job_id":null,"html_url":"https://github.com/markekraus/BetterTls","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/markekraus/BetterTls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markekraus%2FBetterTls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markekraus%2FBetterTls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markekraus%2FBetterTls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markekraus%2FBetterTls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markekraus","download_url":"https://codeload.github.com/markekraus/BetterTls/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markekraus%2FBetterTls/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267718279,"owners_count":24133448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:03:31.198Z","updated_at":"2025-07-29T16:32:00.149Z","avatar_url":"https://github.com/markekraus.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"# BetterTls\n\n## Module Information\n\nBetterTls is a PowerShell Module to manage TLS settings for `Invoke-WebRequest` and `Invoke-RestMethod` in Windows PowerShell 5.1 and older.\n\nIn Windows PowerShell 5.1 and older, only SSL 3.0 and TLS 1.0 are enabled by default.\nMany modern APIs, including GitHub, have begun moving to support only TLS 1.2.\nIf you attempt to use those APIs with `Invoke-WebRequest` and/or `Invoke-RestMethod` you will received the following error:\n\n```none\nInvoke-RestMethod : The request was aborted: Could not create SSL/TLS secure channel.\nAt line:1 char:1\n+ Invoke-RestMethod https://api.github.com/repositories/49609581/issues ...\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException\n    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand\n\nInvoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel.\nAt line:1 char:1\n+ Invoke-WebRequest https://api.github.com/repositories/49609581/issues ...\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException\n    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand\n```\n\nThis module provides best practice ways to enable and disable TLS protocols.\nMany module and script authors are setting these directly without prompting for user consent.\nThat practice is dangerous as it may decrease the user's security or break access to previously working APIs.\nThese settings affect .NET APIs beyond just `Invoke-WebRequest` and `Invoke-RestMethod`.\nAdditionally, the settings persist for the duration of the user's PowerShell Session at the AppDomain level.\nThese authors mean well, but may not fully understand all the implications of their actions.\n\nThe functions in this module require user consent before making changes to the TLS settings,\nbut only when settings are actually required.\nIf the user's settings already include the code authors desired settings,\nthen the user is not prompted and no changes are made.\n\nThe confirmation prompts can be suppressed for automation jobs.\nHowever, when working with user facing and interactive code, the prompts should not be suppressed.\nThis allows the user to be made aware of the changes being made to their session.\n\nPowerShell Core 6.0.0 and later do not require this module.\n`Invoke-WebRequest` and `Invoke-RestMethod` are not affected by settings made to `System.Net.ServicePointManager` in PowerShell Core.\nTLS 1.0, 1.1, and 1.2 are enabled by default in PowerShell Core.\nFor more information on this and other differences please [see my blog](https://get-powershellblog.blogspot.com/2017/11/powershell-core-web-cmdlets-in-depth.html).\n\n## Installation\n\nBetterTls is available on the [PowerShell Gallery](https://www.powershellgallery.com/packages/BetterTls/). To install to the following:\n\n```powershell\nInstall-Module -Scope CurrentUser -Name BetterTls\n```\n\n## Including in Your Module\n\nTo include BetterTls in your PowerShell Gallery module, add the following to your `.psd1`\n\n```powershell\nRequiredModules = @('BetterTls')\n```\n\nTo enable TLS 1.2 for your module code, include the following in your `.psm1`:\n\n```powershell\nEnable-Tls -Tls12\n```\n\nThat's it!\nThe user will be prompted to enable TLS 1.2 upon module load.\nYou can also include this before any code that accesses an endpoint that requires TLS 1.2.\nIf the user already has TLS 1.2 enabled, they will not be prompted and no changes will be made.\nIf the user has disabled TLS 1.2 since module load then they would be prompted again to enable it.\n\n## Documentation\n\nYou can find documentation [here](https://github.com/markekraus/BetterTls/blob/master/Docs/BetterTls.md) or by running the following in PowerShell:\n\n```powershell\nGet-Help Enable-Tls\nGet-Help Disable-Tls\nGet-Help Set-Tls\nGet-Help Get-Tls\n```\n\n## Support\n\nFor support, please open an [issue](https://github.com/markekraus/BetterTls/issues/new).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkekraus%2FBetterTls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkekraus%2FBetterTls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkekraus%2FBetterTls/lists"}