Skip to content

Commit

Permalink
sipexer: apply -timeout-connect to tls
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Feb 9, 2025
1 parent 4a9a253 commit cee3bd8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sipexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,15 @@ func SIPExerSendTLS(dstSockAddr sgsip.SGSIPSocketAddress, tplstr string, tplfiel
tlc.InsecureSkipVerify = true
}

seDlg.ConnTLS.Conn, err = tls.Dial(strAFProto, dstSockAddr.Addr+":"+dstSockAddr.Port, &tlc)
if cliops.timeoutconnect > 0 {
netDialer := net.Dialer{
Timeout: time.Millisecond * time.Duration(cliops.timeoutconnect),
}
seDlg.ConnTLS.Conn, err = tls.DialWithDialer(&netDialer, strAFProto,
dstSockAddr.Addr+":"+dstSockAddr.Port, &tlc)
} else {
seDlg.ConnTLS.Conn, err = tls.Dial(strAFProto, dstSockAddr.Addr+":"+dstSockAddr.Port, &tlc)
}
if err != nil {
SIPExerPrintf(SIPExerLogError, "error: %v\n", err)
tchan <- SIPExerErrTLSDial
Expand Down

0 comments on commit cee3bd8

Please sign in to comment.