Add argument to set InsecureSkipVerify when creating tls Config

main
Stefano 2022-02-03 13:34:40 +01:00
parent 3723666343
commit dd6ad0099d
1 changed files with 2 additions and 2 deletions

View File

@ -136,13 +136,13 @@ type XdccTransfer struct {
events chan TransferEvent
}
func NewXdccTransfer(url IRCFileURL, filePath string) *XdccTransfer {
func NewXdccTransfer(url IRCFileURL, filePath string, skipCertificateCheck bool) *XdccTransfer {
rand.Seed(time.Now().UTC().UnixNano())
nick := IRCClientUserName + strconv.Itoa(int(rand.Uint32()))
config := irc.NewConfig(nick)
config.SSL = true
config.SSLConfig = &tls.Config{ServerName: url.Network}
config.SSLConfig = &tls.Config{ServerName: url.Network, InsecureSkipVerify: skipCertificateCheck}
config.Server = url.Network
config.NewNick = func(nick string) string {
return nick + "" + strconv.Itoa(int(rand.Uint32()))