WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 months ago

#34883 new enhancement

Support TLS Client Certificates

Reported by: Outlandish Josh Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: HTTP API Keywords: has-patch needs-unit-tests needs-upstream
Focuses: Cc:
PR Number:

Description

As we get savvier about TLS as part of the HTTPS Everywhere movement, one use-case that would be nice to support is using Client Certificates when making HTTPS requests. Using client certificates for authentication is a strong way to build trusted APIs.

This looks like it would be fairly straightforward to implement as the option is supported by both Curl and PHP stream contexts (CURLOPT_SSLCERT or local_cert, respectively). We'd just need to add the handling for specifying the path to a client cert as part of the $options array in the API calls, and turn that in the proper option for the actual transporter.

I should be able to create a patch for this shortly.

Attachments (2)

34883.diff (2.5 KB) - added by Outlandish Josh 4 years ago.
Adding client cert option to HTTP reqests API
34883-correct.diff (2.7 KB) - added by Outlandish Josh 4 years ago.
Corrected patch. I derped the first one.

Download all attachments as: .zip

Change History (5)

@Outlandish Josh
4 years ago

Adding client cert option to HTTP reqests API

@Outlandish Josh
4 years ago

Corrected patch. I derped the first one.

#1 @johnbillion
4 years ago

  • Keywords has-patch added
  • Version trunk deleted

#2 @danielbachhuber
4 years ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

#3 @dd32
3 years ago

  • Keywords needs-upstream added

As we've now switched to using Requests in core, this should be submitted as an enhancement for Requests.

Note: See TracTickets for help on using tickets.