<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-part-2-when-the-server-needs-to-trust-the-client-u3icrtiag" -->

---
title: A visual guide to Public Key Infrastructure (PKI) Part 2...
description: A visual walkthrough of Mutual TLS (mTLS), explaining how a server verifies a client's identity using certificates. Covers generating a client key pair and CSR...
canonical: https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-part-2-when-the-server-needs-to-trust-the-client-u3icrtiag
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A visual guide to Public Key Infrastructure (PKI) Part 2 — When the Server Needs to Trust the Client | daily.dev
og:description: A visual walkthrough of Mutual TLS (mTLS), explaining how a server verifies a client's identity using certificates. Covers generating a client key pair and CSR...
og:url: https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-part-2-when-the-server-needs-to-trust-the-client-u3icrtiag
og:image: https://api.daily.dev/og/posts/u3icrtIag.png
og:image:alt: A visual guide to Public Key Infrastructure (PKI) Part 2 — When the Server Needs to Trust the Client
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A visual guide to Public Key Infrastructure (PKI) Part 2 — When the Server Needs to Trust the Client

**[Towards Dev](https://daily.dev/sources/towardsdev)** · 7 min read · 0 upvotes · 0 comments

## Summary

A visual walkthrough of Mutual TLS (mTLS), explaining how a server verifies a client's identity using certificates. Covers generating a client key pair and CSR with OpenSSL, the mTLS handshake steps (CertificateRequest, client certificate, CertificateVerify), and the server's five-step verification checklist covering certificate validity, chain trust, key usage/revocation, private key possession, and identity authorization. Concludes that authentication and authorization are distinct, and teases a follow-up on how Kubernetes uses mTLS for kubectl authentication.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://towardsdev.com/visual-guide-mtls-mutual-authentication-pki-7d77441533b1>

## Questions this post answers

### What is the difference between TLS and mTLS?

With regular TLS, only the server proves its identity to the client using a certificate. With mutual TLS (mTLS), the client also presents its own certificate so the server can verify the caller's identity before accepting the request. This is commonly used for service-to-service communication in microservice architectures, such as a payment-service calling an account-service, where both sides need to authenticate each other rather than just encrypt the connection.

_Explore more explainers on securing service-to-service communication with mTLS on daily.dev._

### How does a server verify a client certificate in mTLS?

The server runs through a checklist: confirming the certificate's validity dates, validating the certificate chain against a trusted CA, checking that the Extended Key Usage extension permits client authentication and that the certificate isn't revoked via CRL or OCSP, verifying the CertificateVerify signature to confirm private key possession, and finally checking whether the mapped identity is authorized to access the requested resource.

_Developers designing zero-trust service auth can dig into mTLS verification steps on daily.dev._

### How do you generate a client certificate for mTLS authentication?

Generate a private key with openssl genpkey using an elliptic-curve algorithm like P-256 (or 2048-bit RSA), then create a Certificate Signing Request with openssl req specifying a Common Name and Organization, for example CN=Sagar/O=MyCompany. Submit the CSR to an internal Certificate Authority, which validates the requester, extracts the public key, and signs and returns the final certificate.

_Engineers setting up internal CAs for client certs can find similar walkthroughs on daily.dev._

## Similar posts on daily.dev

- [A visual guide to Public Key Infrastructure\(PKI\) — From Plaintext to a Verified Certificate](https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-from-plaintext-to-a-verified-certificate-kbxvo51s6) · Towards Dev · 0 upvotes · 0 comments
- [Mutual TLS \(mTLS\) Authentication A Complete Guide](https://daily.dev/posts/mutual-tls-mtls-authentication-a-complete-guide-s8a9whgm7) · GitGuardian · 0 upvotes · 0 comments
- [Mutual TLS in SingleStore](https://daily.dev/posts/mutual-tls-in-singlestore-07wanpuno) · SingleStore · 0 upvotes · 0 comments
- [WebPKI and You](https://daily.dev/posts/webpki-and-you-auxufh8pa) · Lobsters · 0 upvotes · 0 comments
- [Web PKI Reimagined with Merkle Tree Certificates](https://daily.dev/posts/web-pki-reimagined-with-merkle-tree-certificates-ancuapixf) · Feisty Duck · 0 upvotes · 0 comments

---

Tags: [#authentication](https://daily.dev/tags/authentication), [#cryptography](https://daily.dev/tags/cryptography)

[View this post on daily.dev](https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-part-2-when-the-server-needs-to-trust-the-client-u3icrtiag)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A visual guide to Public Key Infrastructure (PKI) Part 2 — When the Server Needs to Trust the Client","url":"https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-part-2-when-the-server-needs-to-trust-the-client-u3icrtiag","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-part-2-when-the-server-needs-to-trust-the-client-u3icrtiag"},"datePublished":"2026-09-04T12:00:48.280Z","dateModified":"2026-09-14T07:44:19.686Z","description":"A visual walkthrough of Mutual TLS (mTLS), explaining how a server verifies a client's identity using certificates. Covers generating a client key pair and CSR...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1744c2aeb5c66dfc6a962a1ff877b8db?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1744c2aeb5c66dfc6a962a1ff877b8db?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Towards Dev","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Towards Dev","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/2c710db2750a4a70835862534cb7c9d4","url":"https://daily.dev/sources/towardsdev"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-part-2-when-the-server-needs-to-trust-the-client-u3icrtiag","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"authentication,cryptography","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Towards Dev","item":"https://daily.dev/sources/towardsdev"},{"@type":"ListItem","position":3,"name":"A visual guide to Public Key Infrastructure (PKI) Part 2 — When the Server Needs to Trust the Client"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/a-visual-guide-to-public-key-infrastructure-pki-part-2-when-the-server-needs-to-trust-the-client-u3icrtiag#faq","mainEntity":[{"@type":"Question","name":"What is the difference between TLS and mTLS?","acceptedAnswer":{"@type":"Answer","text":"With regular TLS, only the server proves its identity to the client using a certificate. With mutual TLS (mTLS), the client also presents its own certificate so the server can verify the caller's identity before accepting the request. This is commonly used for service-to-service communication in microservice architectures, such as a payment-service calling an account-service, where both sides need to authenticate each other rather than just encrypt the connection. Explore more explainers on securing service-to-service communication with mTLS on daily.dev."}},{"@type":"Question","name":"How does a server verify a client certificate in mTLS?","acceptedAnswer":{"@type":"Answer","text":"The server runs through a checklist: confirming the certificate's validity dates, validating the certificate chain against a trusted CA, checking that the Extended Key Usage extension permits client authentication and that the certificate isn't revoked via CRL or OCSP, verifying the CertificateVerify signature to confirm private key possession, and finally checking whether the mapped identity is authorized to access the requested resource. Developers designing zero-trust service auth can dig into mTLS verification steps on daily.dev."}},{"@type":"Question","name":"How do you generate a client certificate for mTLS authentication?","acceptedAnswer":{"@type":"Answer","text":"Generate a private key with openssl genpkey using an elliptic-curve algorithm like P-256 (or 2048-bit RSA), then create a Certificate Signing Request with openssl req specifying a Common Name and Organization, for example CN=Sagar/O=MyCompany. Submit the CSR to an internal Certificate Authority, which validates the requester, extracts the public key, and signs and returns the final certificate. Engineers setting up internal CAs for client certs can find similar walkthroughs on daily.dev."}}]}
```

