{"id":15790258,"url":"https://github.com/grokify/mtlsproxy","last_synced_at":"2026-01-11T02:43:51.750Z","repository":{"id":229857579,"uuid":"745004266","full_name":"grokify/mtlsproxy","owner":"grokify","description":"Simple mTLS reverse proxy to handle mTLS with client","archived":false,"fork":false,"pushed_at":"2024-04-29T18:08:47.000Z","size":21,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-29T19:30:04.326Z","etag":null,"topics":[],"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/grokify.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":"2024-01-18T12:58:12.000Z","updated_at":"2024-06-01T16:06:28.481Z","dependencies_parsed_at":"2024-03-26T16:51:20.706Z","dependency_job_id":"926d4c7e-7cf3-428b-8db7-78d94b964ad8","html_url":"https://github.com/grokify/mtlsproxy","commit_stats":null,"previous_names":["grokify/mtlsproxy"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grokify%2Fmtlsproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grokify%2Fmtlsproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grokify%2Fmtlsproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grokify%2Fmtlsproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grokify","download_url":"https://codeload.github.com/grokify/mtlsproxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246520538,"owners_count":20790969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-04T22:20:46.121Z","updated_at":"2026-01-11T02:43:51.745Z","avatar_url":"https://github.com/grokify.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mTLS Proxy\n\n[![Build Status][build-status-svg]][build-status-url]\n[![Lint Status][lint-status-svg]][lint-status-url]\n[![Go Report Card][goreport-svg]][goreport-url]\n[![Docs][docs-godoc-svg]][docs-godoc-url]\n[![License][license-svg]][license-url]\n\n [build-status-svg]: https://github.com/grokify/mtlsproxy/actions/workflows/ci.yaml/badge.svg?branch=main\n [build-status-url]: https://github.com/grokify/mtlsproxy/actions/workflows/ci.yaml\n [lint-status-svg]: https://github.com/grokify/mtlsproxy/actions/workflows/lint.yaml/badge.svg?branch=main\n [lint-status-url]: https://github.com/grokify/mtlsproxy/actions/workflows/lint.yaml\n [goreport-svg]: https://goreportcard.com/badge/github.com/grokify/mtlsproxy\n [goreport-url]: https://goreportcard.com/report/github.com/grokify/mtlsproxy\n [docs-godoc-svg]: https://pkg.go.dev/badge/github.com/grokify/mtlsproxy\n [docs-godoc-url]: https://pkg.go.dev/github.com/grokify/mtlsproxy\n [license-svg]: https://img.shields.io/badge/license-MIT-blue.svg\n [license-url]: https://github.com/grokify/mtlsproxy/blob/master/LICENSE\n\nThis is a simple Mutual TLS (mTLS) reverse proxy that handles mTLS with the client.\n\n## Clone the Server\n\n```\n% git clone https://github.com/grokify/mtlsproxy\n% cd mtlsproxy\n```\n\n## Generate Key and Certificate\n\nCreate test keys and certificates for server and client usage in non-interactive mode with 1 day expiration.\n\n```\n% openssl req -x509 -newkey rsa:4096 -keyout server_key.pem -out server_cert.pem -sha256 -days 1 -nodes -subj \"/C=US/ST=California/L=Silicon Valley/O=Local/OU=Host/CN=localhost\"\n% openssl req -x509 -newkey rsa:4096 -keyout client_key.pem -out client_cert.pem -sha256 -days 1 -nodes -subj \"/C=US/ST=California/L=Silicon Valley/O=Local/OU=Host/CN=client\"\n```\n\nRef: https://stackoverflow.com/a/10176685/1908967\n\n## Configure and Start Server\n\n```\n% export MTLSP_SERVER_KEY_PATH=server_key.pem\n% export MTLSP_SERVER_CERT_PATH=server_cert.pem\n% export MTLSP_CLIENT_CA_PATHS=client_cert.pem\n% export MTLSP_UPSTREAM_URL=http://example.com\n% export MTLSP_PORT=8080\n% go run main.go\n2024/03/26 07:36:57 listen:  [::]:8080\n```\n\n## Make mTLS Request using cURL\n\n```\n% curl --cert client_cert.pem --key client_key.pem --cacert server_crt.pem  https://localhost:8080\n```\n\nReturns page from http://example.com.\n\n## References\n\n1. https://pkg.go.dev/net/http/httputil#ReverseProxy\n1. https://gist.github.com/JalfResi/6287706\n1. https://github.com/habibiefaried/mtls-tcp-proxy/tree/main\n1. https://github.com/picatz/mtls-proxy\n1. https://stackoverflow.com/questions/76684798/proxy-server-in-go-using-existing-net-conn\n1. https://stackoverflow.com/questions/35390726/confirm-tls-certificate-while-performing-reverseproxy-in-golang\n1. https://blog.joshsoftware.com/2021/05/25/simple-and-powerful-reverseproxy-in-go/\n1. https://medium.com/trendyol-tech/golang-ile-custom-reverse-proxy-yapmak-7a4198fe86fc\n1. https://stackoverflow.com/questions/63899700/how-to-stop-showing-target-url-in-reverseproxy-in-golang-using-newsinglehostreve\n1. https://stackoverflow.com/questions/54385164/golang-reverse-proxy-multiple-target-urls-without-appending-subpaths\n1. https://stackoverflow.com/questions/23164547/golang-reverseproxy-not-working\n1. https://stackoverflow.com/questions/50694429/curl-with-client-certificate-authentication\n1. https://stackoverflow.com/questions/70207857/reverse-proxy-using-go-to-cloud-run-instance\n1. https://www.integralist.co.uk/posts/golang-reverse-proxy/\n1. https://github.com/picatz/mtls-proxy/blob/main/pkg/proxy/server.go\n1. https://www.reddit.com/r/golang/comments/zdsgon/octoproxy_simple_tcptls_proxy_support_mutual/\n1. https://smallstep.com/hello-mtls/doc/combined/go/nginx-proxy\n1. https://smallstep.com/hello-mtls/doc/client/curl\n1. https://medium.com/@brucifi/working-with-tls-client-certificates-f67437a9aeb9\n1. https://downey.io/notes/dev/curl-using-mutual-tls/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrokify%2Fmtlsproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrokify%2Fmtlsproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrokify%2Fmtlsproxy/lists"}