Is it more secure to retrieve a client cert from their host rather than accept the cert presented in request?
Example:
- B2B
- Client pre-shares public cert with me
- I store public cert in database
- Later, client sends GET request + cert to my HTTPS endpoint
- Endpoint has
Enforce HTTPS
andRequire client certs
set totrue
- Endpoint has
- Python code takes client cert from GET request and compares the properties to those in the pre-shared cert from database (cert pinning of sorts)
valid_not_before/after
issuer
common_name
- etc.
- Python code then:
- Determines OCSP responder url from client cert in request
- Retrieves issuer cert
- Creates an OCSP request
- Verifies OCSP response is
GOOD
- Only then does the api perform work for the requestor
Question:
- Is it possible/is there any benefit to instead:
- Parsing the hostname from client cert in the request
- Retrieving the client cert from client source (
hostname.com:443
) - Then using this retrieved cert to compare with the pre-shared cert from database and make OCSP calls, etc?
Hope this makes sense.