gin-gonic / autotls Goto Github PK
View Code? Open in Web Editor NEWSupport Let's Encrypt for a Go server application.
License: MIT License
Support Let's Encrypt for a Go server application.
License: MIT License
I am using graceful-shutdown and now want to add LetsEncrypt via autotls but struggling how-to
srv := &http.Server{
Addr: url + ":" + port,
Handler: r,
}
srv.ListenAndServe()
vs
autotls.Run(routes, domains ...)
How this is possible?
Hi I am trying to whitelist my localhost for development. I am running into this error.
http: TLS handshake error from 127.0.0.1:2072: acme/autocert: missing server name
Here is my run command
log.Fatal(autotls.Run(router, "192.168.99.100","127.0.0.1"))
main.go:
package main
import (
"log"
"net/http"
"github.com/gin-gonic/autotls"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
// Ping handler
r.GET("/ping", func(c *gin.Context) {
c.String(http.StatusOK, "pong")
})
log.Fatal(autotls.Run(r, "example1.com", "example2.com"))
}
After running the main.go,I typed https://localhost:443/ping in browser, I just get "ERR_SSL_PROTOCOL_ERROR" wrong message.
And the console shows the error messages as below:
2023/01/22 17:58:05 http: TLS handshake error from [::1]:51238: acme/autocert: server name component count invalid
2023/01/22 17:58:05 http: TLS handshake error from [::1]:51239: acme/autocert: server name component count invalid
2023/01/22 17:58:05 http: TLS handshake error from [::1]:51240: acme/autocert: server name component count invalid
2023/01/22 17:58:06 http: TLS handshake error from [::1]:51241: acme/autocert: server name component count invalid
I don't know what happens. Who can tell me why?
How to set timeout
I want to change the default port running from 443 to another port. But i don't know how to do it.
how can i do this?
acme/autocert: unable to authorize ""; tried ["tls-sni-02" "tls-sni-01"]
disabled ["tls-sni-02" "tls-sni-01"]
Excuse me?
After this framework automatically implements stl, how do I configure the listening port for the service? Can I only use 80 as the listening port by default?
Also, how should this framework configure universal domain names, such as *. xxx.com, which matches all by default.
I haven't found a solution to these two problems yet. Can someone tell me?
I'm in a hurry and waiting for your response online. If you can, see if you can help me write a demo for the above two questions. thank you!
Curious to know the motivation behind creating this, given the below exists which solves the same problem i believe
http: TLS handshake error from 82.34.xxx.xxx:55065: acme/autocert: unable to authorize "xxx.xxx.xxx"; tried ["tls-sni-02" "tls-sni-01"]
How do I specify a custom port?
Before now, I use
r.RunTLS(":4452", "/path/cert.pem", "/path/privkey.pem")
Explain:
log.Fatal(autotls.Run(r, "example1.com", "example2.com"))
The moment I add autotls to gin gonic, I get this:
build asdasd: cannot load github.com/ugorji/go/codec: ambiguous import: found github.com/ugorji/go/codec in multiple modules:
github.com/ugorji/go v1.1.4 (/home/gunix/.go/pkg/mod/github.com/ugorji/[email protected]/codec)
github.com/ugorji/go/codec v0.0.0-20181209151446-772ced7fd4c2 (/home/gunix/.go/pkg/mod/github.com/ugorji/go/[email protected])
Seems to be the same issue as this one, however it appears only if I add github.com/gin-gonic/autotls
to the project.
Hello,
When I include multiple roots like:
log.Fatal(autotls.Run(r, "www.site.com", "site.com", "site2.com", "www.site2.com"))
I am only seeing site.com
being auto-upgraded. site2.com
is being served at :443
but not getting redirected from :80
. Am I doing something wrong?
I get Error with messager :"TLS handshake error from 213.202.233.86:13765: tls: first record does not look like a TLS handshake". Please help me. I run on google Cloud
I'm attempting to install autotls fetches github.com/gin-gonic/gin/json
.
However that package is now at gin-gonic/gin/internal/json
. I can't resolve this issue myself so far.
Or do I have to fork this project to be able to configure it?
Hi, the Let's encrypt cert should expire after several months. Will the autotls renew it?
When I use cloudflare, there is an endless loop of redirects going on
https://developers.cloudflare.com/ssl/troubleshooting/too-many-redirects/#redirect-rules
Fixed the problem locally by removing the redirect.
I would like to be able to disable redirection
Recommend tagging a new release now, and then after each cycle.
Not having the last release tagged caused problems vendoring autotls via the dep tool.
Turns out this project has a single outdated tagged release which the dep tool defaults to over the latest master branch.
Work-around to enable vendoring is to manually set the constraint in Gopakg.toml to:
[[constraint]]
branch = "master"
name = "github.com/gin-gonic/autotls"
I've been trying to get a SSL certificate, but my ISP blocks port 80 and my domain service doesn't allow to set CNAME records.
As I way about to give up I stumbled upon autotls and it magically generated a certificate for me.
My question is: How?
Can someone explain this to me?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.