Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls-sni disabled on LetsEncrypt #7

Closed
SilverCory opened this issue Jun 11, 2018 · 6 comments
Closed

tls-sni disabled on LetsEncrypt #7

SilverCory opened this issue Jun 11, 2018 · 6 comments

Comments

@SilverCory
Copy link

SilverCory commented Jun 11, 2018

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"]

@deepch
Copy link

deepch commented Jun 17, 2018

Also does not work.

@SilverCory
Copy link
Author

SilverCory commented Jun 17, 2018

@deepch it won't because tls-sni is disabled on letsencrypt's end, you have to use http-01

You can do this in a manner similar to below

	m := &autocert.Manager{
		Prompt:     autocert.AcceptTOS,
		HostPolicy: autocert.HostWhitelist(panel.Config.Web.DomainNames[0:]...),
	}
	dir := cacheDir()
	fmt.Println("Using cache: ", dir)
	if err := os.MkdirAll(dir, 0700); err != nil {
		log.Printf("warning: autocert.NewListener not using a cache: %v", err)
	} else {
		m.Cache = autocert.DirCache(dir)
	}
	go http.ListenAndServe(":http", m.HTTPHandler(nil))
	return autotls.RunWithManager(panel.GinInstance, *m)

@deepch
Copy link

deepch commented Jun 17, 2018

this method redirect http to https I need pure :80 and https ;(

@SilverCory
Copy link
Author

@deepch you can turn of the redirect by supplying a handler in m.HTTPHandler(...)

@deepch
Copy link

deepch commented Jun 17, 2018

thx I run it

	m := &autocert.Manager{
		Prompt:     autocert.AcceptTOS,
		HostPolicy: autocert.HostWhitelist(panel.Config.Web.DomainNames[0:]...),
	}
	dir := cacheDir()
	fmt.Println("Using cache: ", dir)
	if err := os.MkdirAll(dir, 0700); err != nil {
		log.Printf("warning: autocert.NewListener not using a cache: %v", err)
	} else {
		m.Cache = autocert.DirCache(dir)
	}
	go http.ListenAndServe(":http", m.HTTPHandler(panel.GinInstance))
	return autotls.RunWithManager(panel.GinInstance, *m)

if use go http.ListenAndServe(":http", m.HTTPHandler(nil)) <--- nil work as redirect
if use go http.ListenAndServe(":http", m.HTTPHandler(panel.GinInstance)) <--- panel.GinInstance work as http and cert receive no problem

thx you.

@appleboy
Copy link
Member

See #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants