{"id":13413795,"url":"https://github.com/adrianosela/sslmgr","last_synced_at":"2025-04-17T05:23:16.572Z","repository":{"id":57496912,"uuid":"179127712","full_name":"adrianosela/sslmgr","owner":"adrianosela","description":"A layer of abstraction the around acme/autocert certificate manager (Golang)","archived":false,"fork":false,"pushed_at":"2024-08-05T15:07:43.000Z","size":63,"stargazers_count":26,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-05T17:39:14.319Z","etag":null,"topics":["acme","acme-client","acme-dns","acme-v2","autocert","certificate","go","golang","graceful","graceful-shutdown","https","https-server","server","ssl","ssl-certificate","ssl-certificates","tls","tls-certificate","x509","x509certificates"],"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/adrianosela.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-02T17:35:38.000Z","updated_at":"2024-08-05T15:07:30.000Z","dependencies_parsed_at":"2024-06-19T15:15:55.665Z","dependency_job_id":"a8a015ac-3398-4fb3-966e-18dd2291ddfd","html_url":"https://github.com/adrianosela/sslmgr","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianosela%2Fsslmgr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianosela%2Fsslmgr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianosela%2Fsslmgr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianosela%2Fsslmgr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianosela","download_url":"https://codeload.github.com/adrianosela/sslmgr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249318899,"owners_count":21250435,"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":["acme","acme-client","acme-dns","acme-v2","autocert","certificate","go","golang","graceful","graceful-shutdown","https","https-server","server","ssl","ssl-certificate","ssl-certificates","tls","tls-certificate","x509","x509certificates"],"created_at":"2024-07-30T20:01:49.495Z","updated_at":"2025-04-17T05:23:16.555Z","avatar_url":"https://github.com/adrianosela.png","language":"Go","readme":"# Simple Secure Server\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/adrianosela/sslmgr)](https://goreportcard.com/report/github.com/adrianosela/sslmgr)\n[![Documentation](https://godoc.org/github.com/adrianosela/sslmgr?status.svg)](https://godoc.org/github.com/adrianosela/sslmgr)\n[![GitHub issues](https://img.shields.io/github/issues/adrianosela/sslmgr.svg)](https://github.com/adrianosela/sslmgr/issues)\n[![license](https://img.shields.io/github/license/adrianosela/sslmgr.svg)](https://github.com/adrianosela/sslmgr/blob/master/LICENSE)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go#security)\n\n#### Prerequisites:\n\n* Your server must be reachable through the provided domain name, this is how LetsEncrypt verifies domain ownership and grants your server a trusted certificate\n\n#### With Default Values:\n\n```\nss, err := sslmgr.NewSecureServer(handler, \"yourhostname.com\")\nif err != nil {\n\tlog.Fatal(err)\n}\nss.ListenAndServe()\n```\n\n**Note:** This option uses the file system as the certificate cache. If your use case does not have a persistent file system, you should provide a value for CertCache in the [ServerConfig](https://godoc.org/github.com/adrianosela/sslmgr#ServerConfig) as shown below.\n\n\n#### With Optional Values:\n\n(Using the [certcache](https://godoc.org/github.com/adrianosela/certcache) library to define a cache)\n\n```\nss, err := sslmgr.NewServer(sslmgr.ServerConfig{\n\tHostnames: []string{os.Getenv(\"CN_FOR_CERTIFICATE\")},\n\tHTTPPort:  \":80\",\n\tHTTPSPort: \":443\",\n\tHandler:   h,\n\tServeSSLFunc: func() bool {\n\t\treturn strings.ToLower(os.Getenv(\"PROD\")) == \"true\"\n\t},\n\tCertCache: certcache.NewLayered(\n\t\tcertcache.NewLogger(),\n\t\tautocert.DirCache(\".\"),\n\t),\n\tReadTimeout:         5 * time.Second,\n\tWriteTimeout:        5 * time.Second,\n\tIdleTimeout:         25 * time.Second,\n\tGracefulnessTimeout: 5 * time.Second,\n\tGracefulShutdownErrHandler: func(e error) {\n\t\tlog.Fatal(e)\n\t},\n})\nif err != nil {\n\tlog.Fatal(err)\n}\n\nss.ListenAndServe()\n```\n","funding_links":[],"categories":["Security","安全","安全领域相关库","Relational Databases"],"sub_categories":["HTTP Clients","HTTP客户端","查询语"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianosela%2Fsslmgr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianosela%2Fsslmgr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianosela%2Fsslmgr/lists"}