Skip to content

Commit

Permalink
verify/server: decrease timeout (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdoxsey authored Nov 28, 2023
1 parent 704eeac commit a74d663
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func (srv *Server) initRouter() {
transport.DialTLSContext = srv.tlsVerifier.DialTLSContext
client := &http.Client{
Transport: transport,
Timeout: maxRemoteWait,
}

expected := &jwt.Expected{
Expand Down
6 changes: 4 additions & 2 deletions tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
"github.com/rs/zerolog/log"
)

const maxRemoteWait = 5 * time.Second

type tlsVerifier struct {
mu sync.Mutex
errors map[string]error
Expand All @@ -23,8 +25,8 @@ func newTLSVerifier() *tlsVerifier {

func (v *tlsVerifier) DialTLSContext(ctx context.Context, network, addr string) (net.Conn, error) {
dialer := &net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
Timeout: maxRemoteWait,
KeepAlive: maxRemoteWait,
DualStack: true,
}
log.Info().Str("addr", addr).Msg("dialing")
Expand Down

0 comments on commit a74d663

Please sign in to comment.