Start work on supporting TLS for tunnels, begin by switching all optional args to the interface instead of the concrete type

This commit is contained in:
idk
2021-02-28 12:34:22 -05:00
parent 529a5f77cb
commit fcdd8b7f52
11 changed files with 558 additions and 541 deletions

View File

@ -47,17 +47,17 @@ func (f *Conf) print() []string {
"outbound.backupQuantity=" + fmt.Sprintf("%d", f.OutBackupQuantity),
"inbound.quantity=" + fmt.Sprintf("%d", f.InQuantity),
"outbound.quantity=" + fmt.Sprintf("%d", f.OutQuantity),
"inbound.allowZeroHop=" + fmt.Sprintf("%b", f.InAllowZeroHop),
"outbound.allowZeroHop=" + fmt.Sprintf("%b", f.OutAllowZeroHop),
"i2cp.fastRecieve=" + fmt.Sprintf("%b", f.FastRecieve),
"i2cp.gzip=" + fmt.Sprintf("%b", f.UseCompression),
"i2cp.reduceOnIdle=" + fmt.Sprintf("%b", f.ReduceIdle),
"i2cp.reduceIdleTime=" + fmt.Sprintf("%d", f.ReduceIdleTime),
"inbound.allowZeroHop=" + fmt.Sprintf("%v", f.InAllowZeroHop),
"outbound.allowZeroHop=" + fmt.Sprintf("%v", f.OutAllowZeroHop),
"i2cp.fastRecieve=" + fmt.Sprintf("%v", f.FastRecieve),
"i2cp.gzip=" + fmt.Sprintf("%v", f.UseCompression),
"i2cp.reduceOnIdle=" + fmt.Sprintf("%v", f.ReduceIdle),
"i2cp.reduceIdleTime=" + fmt.Sprintf("%v", f.ReduceIdleTime),
"i2cp.reduceQuantity=" + fmt.Sprintf("%d", f.ReduceIdleQuantity),
"i2cp.closeOnIdle=" + fmt.Sprintf("%b", f.CloseIdle),
"i2cp.closeOnIdle=" + fmt.Sprintf("%v", f.CloseIdle),
"i2cp.closeIdleTime=" + fmt.Sprintf("%d", f.CloseIdleTime),
"i2cp.messageReliability=" + f.MessageReliability,
"i2cp.encryptLeaseSet=" + fmt.Sprintf("%b", f.EncryptLeaseSet),
"i2cp.encryptLeaseSet=" + fmt.Sprintf("%v", f.EncryptLeaseSet),
"i2cp.leaseSetEncType=" + fmt.Sprintf("%s", f.LeaseSetEncType),
lsk, lspk, lspsk,
f.accesslisttype(),

View File

@ -1,6 +1,7 @@
package i2ptunconf
import (
"crypto/tls"
"io/ioutil"
"log"
"os"
@ -66,6 +67,8 @@ type Conf struct {
exists bool `default:false`
UserName string `default:""`
Password string `default:""`
UseTLS bool `default:false`
TLSConf *tls.Config
LoadedKeys i2pkeys.I2PKeys
}