mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
letsencrypt: Don't store KeyFile as field in user; staying consistent
This commit is contained in:
parent
a729be295a
commit
9a4e26a518
1 changed files with 2 additions and 4 deletions
|
@ -20,7 +20,6 @@ import (
|
||||||
type User struct {
|
type User struct {
|
||||||
Email string
|
Email string
|
||||||
Registration *acme.RegistrationResource
|
Registration *acme.RegistrationResource
|
||||||
KeyFile string
|
|
||||||
key *rsa.PrivateKey
|
key *rsa.PrivateKey
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +63,7 @@ func getUser(email string) (User, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// load their private key
|
// load their private key
|
||||||
user.key, err = loadRSAPrivateKey(user.KeyFile)
|
user.key, err = loadRSAPrivateKey(storage.UserKeyFile(email))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return user, err
|
return user, err
|
||||||
}
|
}
|
||||||
|
@ -82,8 +81,7 @@ func saveUser(user User) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// save private key file
|
// save private key file
|
||||||
user.KeyFile = storage.UserKeyFile(user.Email)
|
err = saveRSAPrivateKey(user.key, storage.UserKeyFile(user.Email))
|
||||||
err = saveRSAPrivateKey(user.key, user.KeyFile)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue