aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-27 03:15:26 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-27 03:15:26 +0100
commitf4cc1699a661197450f86a61f7c53e9c0b96bef1 (patch)
treef6b3d2d5d283922e858a7021860bf33466a94a0a /cmd
parent510e7288aa74c7660e725863f29424e76c475b31 (diff)
bikeshading
Diffstat (limited to 'cmd')
-rw-r--r--cmd/acme/config.go11
-rw-r--r--cmd/acme/main.go4
2 files changed, 8 insertions, 7 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go
index 1180f16..41561f4 100644
--- a/cmd/acme/config.go
+++ b/cmd/acme/config.go
@@ -25,6 +25,7 @@ type Config struct {
type defaults struct {
Gracetime duration
Listen string
+ ListenTLS string
Provider string
Account string
Basedir string
@@ -143,12 +144,12 @@ func LoadConfig(fname string) (*Config, error) {
type PrivKey interface {
KeyPath() string
KeySize() int
- KeyExists() bool
+ HasKey() bool
}
type Cert interface {
CertPath() string
- CertExists() bool
+ HasCert() bool
}
func exists(fname string) bool {
@@ -161,12 +162,12 @@ func exists(fname string) bool {
func (d desire) CertPath() string { return d.Cert }
func (d desire) KeyPath() string { return d.Key }
func (d desire) KeySize() int { return d.Size }
-func (d desire) KeyExists() bool { return exists(d.Key) }
-func (d desire) CertExists() bool { return exists(d.Cert) }
+func (d desire) HasKey() bool { return exists(d.Key) }
+func (d desire) HasCert() bool { return exists(d.Cert) }
func (a account) KeyPath() string { return a.Key }
func (a account) KeySize() int { return a.Size }
-func (a account) KeyExists() bool { return exists(a.Key) }
+func (a account) HasCert() bool { return exists(a.Key) }
type duration struct{ time.Duration }
diff --git a/cmd/acme/main.go b/cmd/acme/main.go
index 2124666..bf05ce9 100644
--- a/cmd/acme/main.go
+++ b/cmd/acme/main.go
@@ -15,7 +15,7 @@ var confName = flag.String("conf", "acme.toml", "configuration file")
func chkKey(k PrivKey) (*rsa.PrivateKey, error) {
key := k.KeyPath()
- if k.KeyExists() {
+ if k.HasKey() {
fd, err := os.Open(key)
if err != nil {
return nil, err
@@ -37,7 +37,7 @@ func chkKey(k PrivKey) (*rsa.PrivateKey, error) {
}
func chkCert(k Cert) error {
- if !k.CertExists() {
+ if !k.HasCert() {
return errors.New("cert missing")
}
return nil