aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-01-27 18:11:40 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-01-27 18:11:40 +0100
commit8db72aece3d2c01f9304e0faf68b43681cfecc9a (patch)
tree77c04cdf5e8888b15d8842f8447bb570201e12fc
parent39176b1d4c6c23cb17d76dfe1549353045236dcd (diff)
Add keyAuth tester
-rw-r--r--account_test.go19
-rw-r--r--solve_tls_test.go2
-rw-r--r--test.key27
3 files changed, 47 insertions, 1 deletions
diff --git a/account_test.go b/account_test.go
new file mode 100644
index 0000000..369f1b8
--- /dev/null
+++ b/account_test.go
@@ -0,0 +1,19 @@
+package acme
+
+import "testing"
+
+const emtpyKA = ".nby9DvkdEB0ex5-IK3bxu1c1HA_bAHxeYzo-8twil28"
+
+func TestKeyAuth(t *testing.T) {
+ a, err := LoadAccount("test.key")
+ if err != nil {
+ t.Error(err)
+ }
+ ka, err := a.KeyAuth("")
+ if err != nil {
+ t.Error(err)
+ }
+ if ka != emtpyKA {
+ t.Error("Got", ka, "expected", emtpyKA)
+ }
+}
diff --git a/solve_tls_test.go b/solve_tls_test.go
index 4f29809..78587cc 100644
--- a/solve_tls_test.go
+++ b/solve_tls_test.go
@@ -7,6 +7,6 @@ const emptySni = "e3b0c44298fc1c149afbf4c8996fb924.27ae41e4649b934ca495991b7852b
func TestSniName(t *testing.T) {
n := sniName("")
if n != emptySni {
- t.Error("got", n, "expected", emptySni)
+ t.Error("Got", n, "expected", emptySni)
}
}
diff --git a/test.key b/test.key
new file mode 100644
index 0000000..d203f39
--- /dev/null
+++ b/test.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAoFDXORujUWucRW5/LIiV5dfnYufCt9z24hAxUhwzY1oeNbF3
+xVyoXLh3mYMpXE35+I4FWZFm4Bp+9rpNexFmHDBhoIhlZIZw2X9kUOAh8wjKQ+5u
+/KF0w8TCQ8uM/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