psf / psf/requests

Option for retrieving peer's TLS certificate

Open
#4,847 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
54.3k
Forks
10.4k
Avg merge
16h 43m
Merged PRs (30d)
3

Description

It would be good to have an option to retrieve the peer's TLS certificate after a request is performed. For example, this is what libcurl provides with CURLINFO_CERTINFO.

There's a StackOverflow thread which offers some rather ugly methods to do this: https://stackoverflow.com/questions/16903528/how-to-get-response-ssl-certificate-from-requests-in-python

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how Requests exposes response and connection data, then compare the requested behavior with libcurl's CURLINFO_CERTINFO and the linked StackOverflow approaches. Define the public option and certificate representation, and verify that callers can retrieve the peer certificate after a request without relying on undocumented internals.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.