Add support for client certificates
This commit is contained in:
parent
d9b63dd0ef
commit
937560e859
20 changed files with 376 additions and 39 deletions
|
@ -1,6 +1,8 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
|
||||
"github.com/khlieng/dispatch/irc"
|
||||
"github.com/khlieng/dispatch/storage"
|
||||
)
|
||||
|
@ -20,6 +22,12 @@ func reconnectIRC() {
|
|||
i.Password = server.Password
|
||||
i.Realname = server.Realname
|
||||
|
||||
if user.Certificate != nil {
|
||||
i.TLSConfig = &tls.Config{
|
||||
Certificates: []tls.Certificate{*user.Certificate},
|
||||
}
|
||||
}
|
||||
|
||||
i.Connect(server.Address)
|
||||
session.setIRC(i.Host, i)
|
||||
go newIRCHandler(i, session).run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue