bastion 0.57.0
ci / personal-data (push) Successful in 4s
ci / test (push) Successful in 4m30s
ci / fuzz (push) Successful in 3m25s

This commit is contained in:
Privatae
2026-10-28 20:35:45 +00:00
parent 4012da0b75
commit 081763a675
26 changed files with 2118 additions and 37 deletions
+8
View File
@@ -149,11 +149,19 @@ func redeemOverTCP(u *url.URL, caPEM string, body []byte) (tcpRedeemResp, error)
if err != nil {
return rr, fmt.Errorf("--host-ca: %w", err)
}
// The dial is dialEnrollPort's: an enroll port that does not answer in
// pairAnswerTimeout gets the pairing window's plain message, not a wait
// for the system's connect timeout.
httpc := &http.Client{Timeout: 30 * time.Second, Transport: &http.Transport{
Proxy: nil, TLSClientConfig: tc, ForceAttemptHTTP2: false,
DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) { return dialEnrollPort(ctx, u) },
}, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
resp, err := httpc.Post(u.String(), "application/json", bytes.NewReader(body))
if err != nil {
var we *pairWindowError
if errors.As(err, &we) {
return rr, we
}
return rr, fmt.Errorf("redeem: %w", err)
}
defer resp.Body.Close()