{"id":18414764,"url":"https://github.com/zoido/trustme-go","last_synced_at":"2025-07-12T22:36:52.571Z","repository":{"id":57513939,"uuid":"239117542","full_name":"zoido/trustme-go","owner":"zoido","description":"Reduce the boilerplate code when testing with TLS","archived":false,"fork":false,"pushed_at":"2023-01-11T14:23:36.000Z","size":35,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T17:44:17.662Z","etag":null,"topics":["go","golang","golang-library","golang-package","testing","tests","tls","x509"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoido.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-08T11:13:28.000Z","updated_at":"2023-07-29T17:38:08.000Z","dependencies_parsed_at":"2023-02-09T03:16:17.722Z","dependency_job_id":null,"html_url":"https://github.com/zoido/trustme-go","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoido%2Ftrustme-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoido%2Ftrustme-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoido%2Ftrustme-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoido%2Ftrustme-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoido","download_url":"https://codeload.github.com/zoido/trustme-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247645099,"owners_count":20972409,"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":["go","golang","golang-library","golang-package","testing","tests","tls","x509"],"created_at":"2024-11-06T03:52:15.783Z","updated_at":"2025-04-07T11:32:52.766Z","avatar_url":"https://github.com/zoido.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD026 --\u003e\n\n# Trust me. Go!\n\n\u003c!-- markdownlint-enable MD026 --\u003e\n\n[![Go](https://github.com/zoido/trustme-go/workflows/Go/badge.svg)](https://github.com/zoido/trustme-go/actions?query=workflow%3AGo)\n[![codecov](https://codecov.io/gh/zoido/trustme-go/branch/master/graph/badge.svg)](https://codecov.io/gh/zoido/trustme-go)\n[![GoDoc](https://godoc.org/github.com/zoido/trustme-go?status.svg)](https://godoc.org/github.com/zoido/trustme-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/zoido/trustme-go)](https://goreportcard.com/report/github.com/zoido/trustme-go)\n\nInspired by [trustme](https://github.com/python-trio/trustme)\nfor [Python](https://www.python.org/).\n\n`trustme-go` is a small Go package that offers you with fake\n[certificate autority](https://en.wikipedia.org/wiki/Certificate_authority)\n(CA) that issues TLS certificates for Go tests for the cases when\n[`httptest.NewTLSServer`](https://golang.org/pkg/net/http/httptest/#NewTLSServer)\nis not enough.\n\n## Example\n\n\u003c!-- markdownlint-disable MD010 --\u003e\n\n```go\nfunc TestExample(t *testing.T) {\n\tca := trustme.New(t)\n\n\tsrvCfg := ca.MustIssue(trustme.WithIP(net.ParseIP(\"127.0.0.1\"))).AsServerConfig()\n\tsrvCfg.ClientAuth = tls.RequireAndVerifyClientCert\n\tlistener, _ := tls.Listen(\"tcp\", \"127.0.0.1:0\", srvCfg)\n\tdefer listener.Close()\n\n\tsrv := http.Server{\n\t\tHandler: http.HandlerFunc(ExampleHandler),\n\t}\n\tdefer srv.Close()\n\tgo srv.Serve(listener)\n\n\tclient := \u0026http.Client{\n\t\tTransport: \u0026http.Transport{\n\t\t\tTLSClientConfig: ca.MustIssue().AsClientConfig(),\n\t\t},\n\t\tTimeout: time.Second * 5,\n\t}\n\n\tclient.Get(fmt.Sprintf(\"https://%s/\", listener.Addr().String()))\n}\n\n```\n\n\u003c!-- markdownlint-enable MD010 --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoido%2Ftrustme-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoido%2Ftrustme-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoido%2Ftrustme-go/lists"}