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

fix: bug email cannot readed #59

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions ta/acme.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ func (u *MyUser) GetPrivateKey() crypto.PrivateKey {
return u.key
}

var email = "[email protected]"

func IssueCertificate(key crypto.PrivateKey, domain string) *certificate.Resource {
func IssueCertificate(key crypto.PrivateKey, domain, email string) *certificate.Resource {
// Create a user. New accounts need an email and private key to start.
privateKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion ta/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
const CERT_DIER_CACHE = "./tmp/ra-webs.cache"

func (ap *TA) TLSConfig() (*tls.Config, error) {
cert := IssueCertificate(ap.privateKey, ap.config.Domain)
cert := IssueCertificate(ap.privateKey, ap.config.Domain, ap.config.Email)

return &tls.Config{
GetCertificate: func(hello *tls.ClientHelloInfo) (*tls.Certificate, error) {
Expand Down
Loading