{"id":37172530,"url":"https://github.com/islishude/grpc-mtls-example","last_synced_at":"2026-01-14T20:10:34.442Z","repository":{"id":57513671,"uuid":"214615383","full_name":"islishude/grpc-mtls-example","owner":"islishude","description":"grpc mTLS example","archived":true,"fork":false,"pushed_at":"2024-04-19T13:35:34.000Z","size":154,"stargazers_count":37,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-20T12:52:50.699Z","etag":null,"topics":["grpc","grpc-go","mtls","tls"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/islishude.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-12T09:07:10.000Z","updated_at":"2024-06-11T15:46:01.000Z","dependencies_parsed_at":"2022-09-26T17:50:29.024Z","dependency_job_id":"c2b13697-c4f6-4fd6-b454-9ac2ba3bd820","html_url":"https://github.com/islishude/grpc-mtls-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/islishude/grpc-mtls-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islishude%2Fgrpc-mtls-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islishude%2Fgrpc-mtls-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islishude%2Fgrpc-mtls-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islishude%2Fgrpc-mtls-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/islishude","download_url":"https://codeload.github.com/islishude/grpc-mtls-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islishude%2Fgrpc-mtls-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc","grpc-go","mtls","tls"],"created_at":"2026-01-14T20:10:33.606Z","updated_at":"2026-01-14T20:10:34.428Z","avatar_url":"https://github.com/islishude.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPC mTLS example\n\n## Install protoc\n\nDownload it from the latest release page\n\nhttps://github.com/protocolbuffers/protobuf/releases/latest\n\nIf you're using MacOS, you can install protoc with brew:\n\n```\nbrew install protobuf\n```\n\nby the way, you can also install clang-format for formating the proto files.\n\n```\nbrew install clang-format\n```\n\nand run following command to format the protobuf files\n\n```sh\nclang-format -i greet/*.proto\n```\n\n## Install protoc generator for golang\n\n```\ngo install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest\ngo install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n```\n\n## Install cfssl\n\nIt's used for generating X509 certificates\n\n```\ngo install github.com/cloudflare/cfssl/cmd/...@latest\n```\n\nyou can also use OpenSSL, but it will become more complex :)\n\n## Build proto files\n\n```\nprotoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative greet/*.proto\n```\n\n## Create root CA\n\n```\ncfssl selfsign -config cfssl.json --profile rootca \"Dev Testing CA\" csr.json | cfssljson -bare root\n```\n\nyou will get 3 files:\n\n- root.csr ROOT CA CSR(you may don't need it)\n- root-key.pem ROOT CA key\n- root.pem ROOT CA certificate\n\nthe `cfss.json` here is a configuration file for cfssl, if you would like use your own `cfss.json` and `csr.json`, please check out the [cfssl](https://github.com/cloudflare/cfssl) documentation for the deails.\n\n## Create certificates for server and client\n\n```\ncfssl genkey csr.json | cfssljson -bare server\ncfssl genkey csr.json | cfssljson -bare client\n```\n\nyou will get 4 files:\n\n- server.csr Server CSR\n- server-key.pem Server key\n- client.csr Client CSR\n- client-key.pem Client key\n\nthe CSR files will be used for signing new certificate\n\n## Sign the certificates\n\n```\ncfssl sign -ca root.pem -ca-key root-key.pem -config cfssl.json -profile server server.csr | cfssljson -bare server\ncfssl sign -ca root.pem -ca-key root-key.pem -config cfssl.json -profile client client.csr | cfssljson -bare client\n```\n\nyou will get your server and client certificates\n\n- server.pem\n- client.pem\n\n## Build client and server\n\n```\nmkdir -p dist\ngo build -o ./dist ./cmd/...\n```\n\n## Run and test\n\n```console\n$ ./dist/server\n2022/07/21 22:18:20 listening on 6443\n2022/07/21 22:18:26 request certificate subject: CN=client\n```\n\n```console\n$ ./dist/client\nHello,world\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislishude%2Fgrpc-mtls-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fislishude%2Fgrpc-mtls-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislishude%2Fgrpc-mtls-example/lists"}