Title: Add User Supplied ServerCertificateCustomValidationCallback Support to Web Cmdlets · Issue #4899 · PowerShell/PowerShell · GitHub
Open Graph Title: Add User Supplied ServerCertificateCustomValidationCallback Support to Web Cmdlets · Issue #4899 · PowerShell/PowerShell
X Title: Add User Supplied ServerCertificateCustomValidationCallback Support to Web Cmdlets · Issue #4899 · PowerShell/PowerShell
Description: Problem Currently users only have 2 options for dealing with Server SSL/TLS Certificates with Invoke-WebRequest and Invoke-RestMethod: the default validation and to skip validation. Some scenarios warrant tighter security on web requests...
Open Graph Description: Problem Currently users only have 2 options for dealing with Server SSL/TLS Certificates with Invoke-WebRequest and Invoke-RestMethod: the default validation and to skip validation. Some scenarios ...
X Description: Problem Currently users only have 2 options for dealing with Server SSL/TLS Certificates with Invoke-WebRequest and Invoke-RestMethod: the default validation and to skip validation. Some scenarios ...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4899
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add User Supplied ServerCertificateCustomValidationCallback Support to Web Cmdlets","articleBody":"# Problem\r\n\r\nCurrently users only have 2 options for dealing with Server SSL/TLS Certificates with `Invoke-WebRequest` and `Invoke-RestMethod`: the default validation and to skip validation. Some scenarios warrant tighter security on web requests where a certificate is not fully trusted by the host environment but is known to be trusted by the user. This could include internal web APIs that use a self signed certificate with a specific thumbprint or from a known CA that is not trusted by the host. Or if a user wishes to ensure a certain CA/Thumbprint/Subject is blocked (a known bad actor).\r\n\r\nAlso `[System.Net.ServicePointManager]::ServerCertificateValidationCallback` has no effect in Core and `HttpClient` only uses the settings provided by `HttpClientHandler`.\r\n\r\n# Proposal\r\n\r\nAdd a parameter of type `Func\u003cHttpRequestMessage,X509Certificate2,X509Chain,SslPolicyErrors,Boolean\u003e` that accepts a ScriptBlock to both Web Cmdlets. This is to be set on `HttpClientHandler.ServerCertificateCustomValidationCallback`. The `-SkipCertificateCheck` would have priority, meaning if both were supplied either a parameter exception is thrown or `-SkipCertificateCheck` would be applied and the callback ignored. \r\n\r\nThe Parameter will be named `CertificateValidationScript`\r\n\r\n# For consideration\r\n\r\n* What to name this parameter?\r\n* Throw or no throw on clash with `-SkipCertificateCheck`?","author":{"url":"https://github.com/markekraus","@type":"Person","name":"markekraus"},"datePublished":"2017-09-22T17:47:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":48},"url":"https://github.com/4899/PowerShell/issues/4899"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5b35630d-e8db-af14-2015-6727cd32115c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7AA:146E92:2B9C6B9:3ECCB3A:6A5677F8 |
| html-safe-nonce | c0a4067282230fcbf005e927a10c52242fdc1c1dbdf66f5ded2bed0c9ce2358a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0FBOjE0NkU5MjoyQjlDNkI5OjNFQ0NCM0E6NkE1Njc3RjgiLCJ2aXNpdG9yX2lkIjoiMzk0OTUzMTQ5MjAwNzcwNDU2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | acdf58dcd0f6ed275848f13eef88565806c45906d0312bcd9a19247cb24f0cb7 |
| hovercard-subject-tag | issue:259888473 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/4899/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d58fb2052e1b5ba5c45ab59f215fe4ff5595b416fc0a8d81636169890416c545/PowerShell/PowerShell/issues/4899 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d58fb2052e1b5ba5c45ab59f215fe4ff5595b416fc0a8d81636169890416c545/PowerShell/PowerShell/issues/4899 |
| og:image:alt | Problem Currently users only have 2 options for dealing with Server SSL/TLS Certificates with Invoke-WebRequest and Invoke-RestMethod: the default validation and to skip validation. Some scenarios ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markekraus |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b5ee9431dcfce15ab4b001d626e4e3a6ba1acb7be814813a52bbebd9a86ef5 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | afc01ffdb045f4ff81c6122091366ade7b6166b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width