AUTH-2167: Adds CLI option for host key directory

This commit is contained in:
Michael Borkenstein
2019-10-17 16:23:06 -05:00
parent 6322c5029d
commit 28cc1c65af
4 changed files with 50 additions and 37 deletions

View File

@@ -78,7 +78,7 @@ type SSHPreamble struct {
}
// New creates a new SSHProxy and configures its host keys and authentication by the data provided
func New(logManager sshlog.Manager, logger *logrus.Logger, version, localAddress, hostname string, shutdownC chan struct{}, idleTimeout, maxTimeout time.Duration) (*SSHProxy, error) {
func New(logManager sshlog.Manager, logger *logrus.Logger, version, localAddress, hostname, hostKeyDir string, shutdownC chan struct{}, idleTimeout, maxTimeout time.Duration) (*SSHProxy, error) {
sshProxy := SSHProxy{
hostname: hostname,
logger: logger,
@@ -98,7 +98,7 @@ func New(logManager sshlog.Manager, logger *logrus.Logger, version, localAddress
},
}
if err := sshProxy.configureHostKeys(); err != nil {
if err := sshProxy.configureHostKeys(hostKeyDir); err != nil {
return nil, err
}