Commit 43c339c7 authored by Matt Holt's avatar Matt Holt

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

https: Fix build after https://github.com/xenolf/lego/commit/0e26b
parents da08c94a 49c2807b
......@@ -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
}
......
......@@ -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) {
......
......@@ -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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment