Add the TLS Configuration to the configuration generator

This commit is contained in:
idk
2021-02-28 16:16:30 -05:00
parent e31a7636d0
commit b47b3971f7
2 changed files with 7 additions and 4 deletions

View File

@ -57,7 +57,7 @@ func (c *Conf) SetUseTLS(label ...string) {
}
// GetTLSConfig
func (c *Conf) GetTLSConfig(arg, def string, label ...string) string {
func (c *Conf) GetTLSConfigCertPem(arg, def string, label ...string) string {
if arg != def {
return arg
}
@ -71,7 +71,7 @@ func (c *Conf) GetTLSConfig(arg, def string, label ...string) string {
}
// SetClientDest sets the key name from the config file
func (c *Conf) SetTLSConfig(label ...string) {
func (c *Conf) SetTLSConfigCertPem(label ...string) {
if v, ok := c.Get("cert.pem", label...); ok {
c.Cert = v
} else {
@ -80,7 +80,7 @@ func (c *Conf) SetTLSConfig(label ...string) {
}
// GetTLSConfig
func (c *Conf) GetTLSConfigPem(arg, def string, label ...string) string {
func (c *Conf) GetTLSConfigKeyPem(arg, def string, label ...string) string {
if arg != def {
return arg
}
@ -94,7 +94,7 @@ func (c *Conf) GetTLSConfigPem(arg, def string, label ...string) string {
}
// SetClientDest sets the key name from the config file
func (c *Conf) SetTLSConfigPem(label ...string) {
func (c *Conf) SetTLSConfigKeyPem(label ...string) {
if v, ok := c.Get("key.pem", label...); ok {
c.Pem = v
} else {

View File

@ -284,6 +284,9 @@ func (c *Conf) I2PINILoad(iniFile string, label ...string) error {
c.SetControlHost(label...)
c.SetControlPort(label...)
c.SetWWWDir(label...)
c.SetUseTLS(label...)
c.SetTLSConfigCertPem(label...)
c.SetTLSConfigKeyPem(label...)
if v, ok := c.Get("i2cp.accessList", label...); ok {
csv := strings.Split(v, ",")
for _, z := range csv {