mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-31 16:23:44 +00:00
ipn/ipnlocal: hacky client changes for test TLS certs
Change-Id: I46d9ab5d01d214fbd971f7472a0a5f64f9f8acb0 Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
parent
f1710f4a42
commit
90ccc1e107
@ -24,6 +24,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
randv2 "math/rand/v2"
|
randv2 "math/rand/v2"
|
||||||
"net"
|
"net"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
@ -550,12 +551,13 @@ func (b *LocalBackend) getCertPEM(ctx context.Context, cs certStore, logf logger
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
csr, err := certRequest(certPrivKey, domain, nil)
|
csr, err := certRequest(certPrivKey, domain, nil, domain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
logf("requesting cert...")
|
logf("requesting cert...")
|
||||||
|
traceACME(csr)
|
||||||
der, _, err := ac.CreateOrderCert(ctx, order.FinalizeURL, csr, true)
|
der, _, err := ac.CreateOrderCert(ctx, order.FinalizeURL, csr, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("CreateOrder: %v", err)
|
return nil, fmt.Errorf("CreateOrder: %v", err)
|
||||||
@ -658,8 +660,16 @@ func acmeClient(cs certStore) (*acme.Client, error) {
|
|||||||
// LetsEncrypt), we should make sure that they support ARI extension (see
|
// LetsEncrypt), we should make sure that they support ARI extension (see
|
||||||
// shouldStartDomainRenewalARI).
|
// shouldStartDomainRenewalARI).
|
||||||
return &acme.Client{
|
return &acme.Client{
|
||||||
Key: key,
|
Key: key,
|
||||||
UserAgent: "tailscaled/" + version.Long(),
|
UserAgent: "tailscaled/" + version.Long(),
|
||||||
|
DirectoryURL: "https://localhost:14000/dir",
|
||||||
|
HTTPClient: &http.Client{
|
||||||
|
Transport: &http.Transport{
|
||||||
|
TLSClientConfig: &tls.Config{
|
||||||
|
InsecureSkipVerify: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user