Title: Add CertificateValidationScript Parameter to Web Cmdlets by markekraus · Pull Request #4970 · PowerShell/PowerShell · GitHub
Open Graph Title: Add CertificateValidationScript Parameter to Web Cmdlets by markekraus · Pull Request #4970 · PowerShell/PowerShell
X Title: Add CertificateValidationScript Parameter to Web Cmdlets by markekraus · Pull Request #4970 · PowerShell/PowerShell
Description: closes #4899 This adds a -CertificateValidationScript parameter to Invoke-RestMethod and Invoke-WebRequest which allows the user to supply a custom validation script as a PowerShell ScriptBlock to validate Server Certificates for HTTPS connections. The ScriptBlock also has 4 automatic variables created which allows the user to use either $args, Param(), or the automatic variables to inspect the HttpRequestMessage being sent to the server, X509Certificate2 certificate returned by the server, the X509Chain certificate chain of the server certificate, and the SslPolicyErrors. The ScriptBlock is converted to a Closure and is wrapped in a Func delegate which is used as the HttpClientHandler.ServerCertificateCustomValidationCallback. The ScriptBlock has access to the calling scope and any ScriptBlock exceptions are treated as a certificate failure. Documentation Needed This new parameter will need to be documented and an example added. The documentation will need to note that the $using: scope is not supported and will result in a certificate failure. it will also need to note that if the site redirects, the same validation script will apply for all hops. Finally, it will also need to state that -SkipCertificateCheck will override anything supplied in -CertificateValidationScript.
Open Graph Description: closes #4899 This adds a -CertificateValidationScript parameter to Invoke-RestMethod and Invoke-WebRequest which allows the user to supply a custom validation script as a PowerShell ScriptBlock to ...
X Description: closes #4899 This adds a -CertificateValidationScript parameter to Invoke-RestMethod and Invoke-WebRequest which allows the user to supply a custom validation script as a PowerShell ScriptBlock to ...
Opengraph URL: https://github.com/PowerShell/PowerShell/pull/4970
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c9a217af-58a2-e600-45ce-83c6adb3ce1d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 886A:2C813C:34812A2:4B26C2A:6A5689B6 |
| html-safe-nonce | 59bbf1c83c9331eb58b346fde4c88609d65c08c35f77f213d848bb8bd3b9d4e7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODZBOjJDODEzQzozNDgxMkEyOjRCMjZDMkE6NkE1Njg5QjYiLCJ2aXNpdG9yX2lkIjoiMTA5ODkwNjQ5ODczMjgyMDkxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 037f9373e2032c2ce53c7d5f5d34ab228e8d9b26aa37f27da5a14a10fb45f69f |
| hovercard-subject-tag | pull_request:144088901 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/PowerShell/PowerShell/pull/4970/files |
| twitter:image | https://avatars.githubusercontent.com/u/6509955?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6509955?s=400&v=4 |
| og:image:alt | closes #4899 This adds a -CertificateValidationScript parameter to Invoke-RestMethod and Invoke-WebRequest which allows the user to supply a custom validation script as a PowerShell ScriptBlock to ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8f21be8503ba8fe6154df415b855c03af52eae3f285bd6ae1fef041dc053da38 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 78af172a48a2056810bb627ffa684003e4f9a5ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width