0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

Merge pull request #641 from hkjn/fix-build-acme-crypt

https: Fix build after https://github.com/xenolf/lego/commit/0e26b
This commit is contained in:
Matt Holt 2016-02-27 10:21:44 -07:00
commit 43c339c7e3
3 changed files with 15 additions and 3 deletions

View file

@ -34,7 +34,16 @@ var NewACMEClient = func(email string, allowPrompts bool) (*ACMEClient, error) {
}
// The client facilitates our communication with the CA server.
client, err := acme.NewClient(CAUrl, &leUser, rsaKeySizeToUse)
var kt acme.KeyType
if rsaKeySizeToUse == Rsa2048 {
kt = acme.RSA2048
} else if rsaKeySizeToUse == Rsa4096 {
kt = acme.RSA4096
} else {
// TODO(hkjn): Support more types? Current changes are quick fix for #640.
return nil, fmt.Errorf("https: unsupported keysize")
}
client, err := acme.NewClient(CAUrl, &leUser, kt)
if err != nil {
return nil, err
}

View file

@ -11,7 +11,9 @@ import (
)
func init() {
rsaKeySizeToUse = 128 // make tests faster; small key size OK for testing
rsaKeySizeToUse = 2048 // TODO(hkjn): Bring back support for small
// keys to speed up tests? Current changes
// are quick fix for #640.
}
func TestSaveAndLoadRSAPrivateKey(t *testing.T) {

View file

@ -2,6 +2,7 @@ package https
import (
"bufio"
"crypto"
"crypto/rand"
"crypto/rsa"
"encoding/json"
@ -34,7 +35,7 @@ func (u User) GetRegistration() *acme.RegistrationResource {
}
// GetPrivateKey gets u's private key.
func (u User) GetPrivateKey() *rsa.PrivateKey {
func (u User) GetPrivateKey() crypto.PrivateKey {
return u.key
}