checking client certificate match
See original GitHub issueHi, In nodejs/express we can do the following:
app.get('/authenticate', (req, res) => {
const cert = req.socket.getPeerCertificate();
if (req.client.authorized) {
res.send(`Hello ${cert.subject.CN}, your certificate was issued by ${cert.issuer.CN}!`);
} else if (cert.subject) {
res.status(403)
.send(`Sorry ${cert.subject.CN}, certificates from ${cert.issuer.CN} are not welcome here.`);
} else {
res.status(401)
.send(`Sorry, but you need to provide a client certificate to continue.`);
}
});
what would be the equivalent in koa to verify client certificate?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Client Certificate Authentication - text/plain
A client may choose not to send a certificate (either because no matching certificate is available, or because the user declined to supply...
Read more >Client Certificate CN Checking - F5 Cloud Docs
These iRules will check the presented client certificate for a valid CN, allowing or rejecting. For either example, if you will be examining...
Read more >How to verify if a Private Key Matches a Certificate? - IBM
If they are identical then the private key matches the certificate. Follow a example: C:\Program Files\OpenSSL\bin>openssl x509 -noout -modulus ...
Read more >Client SSL Certificate Validation - Avi Networks
A client's certificate must match the CA as the root of the chain. If the presented certificate has an intermediate chain, then each...
Read more >Verify the Integrity of an SSL/TLS certificate and Private Key Pair
Use OpenSSL to confirm Private Key's Integrity · Confirm the Modulus Value Matching with Private Key and SSL/TLS certificate Key Pair · Perform ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Welcome @ilanl, I believe that the problem is from @types/koa. So you need to do something like that:
As a full working example was provided and this ticket has been stale for 20 days I’m going to close it. Please re-open if you feel you still need help or feedback.