acme, acme/autocert: switch to Go 1.7+ context package

The standard library context package has been available since Go 1.7,
and the Go build dashboard (build.golang.org) only tests master and
the past two releases.

Also, the acme package makes no backwards compatibility guarantees,
not that I expect this to influence many people.

Change-Id: Ia1a294212e1e531f28f53cd954d4743a64611cab
Reviewed-on: https://go-review.googlesource.com/39272
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/acme/acme.go b/acme/acme.go
index 8619508..03e24e4 100644
--- a/acme/acme.go
+++ b/acme/acme.go
@@ -15,6 +15,7 @@
 
 import (
 	"bytes"
+	"context"
 	"crypto"
 	"crypto/ecdsa"
 	"crypto/elliptic"
@@ -37,7 +38,6 @@
 	"sync"
 	"time"
 
-	"golang.org/x/net/context"
 	"golang.org/x/net/context/ctxhttp"
 )
 
diff --git a/acme/acme_test.go b/acme/acme_test.go
index 1205dbb..e746c07 100644
--- a/acme/acme_test.go
+++ b/acme/acme_test.go
@@ -6,6 +6,7 @@
 
 import (
 	"bytes"
+	"context"
 	"crypto/rand"
 	"crypto/rsa"
 	"crypto/tls"
@@ -23,8 +24,6 @@
 	"strings"
 	"testing"
 	"time"
-
-	"golang.org/x/net/context"
 )
 
 // Decodes a JWS-encoded request and unmarshals the decoded JSON into a provided
diff --git a/acme/autocert/autocert.go b/acme/autocert/autocert.go
index dfb860f..f50c88e 100644
--- a/acme/autocert/autocert.go
+++ b/acme/autocert/autocert.go
@@ -10,6 +10,7 @@
 
 import (
 	"bytes"
+	"context"
 	"crypto"
 	"crypto/ecdsa"
 	"crypto/elliptic"
@@ -30,7 +31,6 @@
 	"time"
 
 	"golang.org/x/crypto/acme"
-	"golang.org/x/net/context"
 )
 
 // pseudoRand is safe for concurrent use.
diff --git a/acme/autocert/autocert_test.go b/acme/autocert/autocert_test.go
index c3f3f66..acef162 100644
--- a/acme/autocert/autocert_test.go
+++ b/acme/autocert/autocert_test.go
@@ -5,6 +5,7 @@
 package autocert
 
 import (
+	"context"
 	"crypto"
 	"crypto/ecdsa"
 	"crypto/elliptic"
@@ -27,7 +28,6 @@
 	"time"
 
 	"golang.org/x/crypto/acme"
-	"golang.org/x/net/context"
 )
 
 var discoTmpl = template.Must(template.New("disco").Parse(`{
diff --git a/acme/autocert/cache.go b/acme/autocert/cache.go
index 9b184aa..9f3e9d1 100644
--- a/acme/autocert/cache.go
+++ b/acme/autocert/cache.go
@@ -5,12 +5,11 @@
 package autocert
 
 import (
+	"context"
 	"errors"
 	"io/ioutil"
 	"os"
 	"path/filepath"
-
-	"golang.org/x/net/context"
 )
 
 // ErrCacheMiss is returned when a certificate is not found in cache.
diff --git a/acme/autocert/cache_test.go b/acme/autocert/cache_test.go
index ad6d4a4..6e1b88d 100644
--- a/acme/autocert/cache_test.go
+++ b/acme/autocert/cache_test.go
@@ -5,13 +5,12 @@
 package autocert
 
 import (
+	"context"
 	"io/ioutil"
 	"os"
 	"path/filepath"
 	"reflect"
 	"testing"
-
-	"golang.org/x/net/context"
 )
 
 // make sure DirCache satisfies Cache interface
diff --git a/acme/autocert/renewal.go b/acme/autocert/renewal.go
index 0d2eb60..14ac905 100644
--- a/acme/autocert/renewal.go
+++ b/acme/autocert/renewal.go
@@ -5,11 +5,10 @@
 package autocert
 
 import (
+	"context"
 	"crypto"
 	"sync"
 	"time"
-
-	"golang.org/x/net/context"
 )
 
 // maxRandRenew is a maximum deviation from Manager.RenewBefore.
diff --git a/acme/autocert/renewal_test.go b/acme/autocert/renewal_test.go
index 27958bb..87474b6 100644
--- a/acme/autocert/renewal_test.go
+++ b/acme/autocert/renewal_test.go
@@ -5,6 +5,7 @@
 package autocert
 
 import (
+	"context"
 	"crypto/ecdsa"
 	"crypto/elliptic"
 	"crypto/rand"
@@ -18,7 +19,6 @@
 	"time"
 
 	"golang.org/x/crypto/acme"
-	"golang.org/x/net/context"
 )
 
 func TestRenewalNext(t *testing.T) {