Skip to content

Commit d029900

Browse files
committed
Automatically set webirc password if cert is provided
1 parent 8a4cb1d commit d029900

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/webircgateway/client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,10 @@ func (c *Client) makeUpstreamConnection() (io.ReadWriteCloser, error) {
404404

405405
func (c *Client) writeWebircLines(upstream io.ReadWriteCloser) {
406406
// Send any WEBIRC lines
407+
if len(c.UpstreamConfig.WebircCertificate) > 0 && c.UpstreamConfig.WebircPassword == "" {
408+
c.UpstreamConfig.WebircPassword = "*"
409+
}
410+
407411
if c.UpstreamConfig.WebircPassword == "" {
408412
c.Log(1, "No webirc to send")
409413
return
@@ -700,7 +704,7 @@ func (c *Client) configureUpstream() ConfigUpstream {
700704
upstreamConfig.Throttle = c.Gateway.Config.GatewayThrottle
701705
upstreamConfig.WebircPassword = c.Gateway.findWebircPassword(c.DestHost)
702706

703-
if upstreamConfig.WebircPassword != "" && c.Gateway.Config.WebircCert != nil {
707+
if c.Gateway.Config.WebircCert != nil {
704708
upstreamConfig.WebircCertificate = []tls.Certificate{
705709
*c.Gateway.Config.WebircCert,
706710
}

0 commit comments

Comments
 (0)