Skip to content

Commit

Permalink
Add CACertificatePath to config
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Mar 22, 2024
1 parent 947b019 commit 204b891
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions commons/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ func setConfigToICommandsEnvMgr(envManager *irodsclient_icommands.ICommandsEnvir
envManager.Environment.ClientServerNegotiation = config.ClientServerNegotiation
envManager.Environment.ClientServerPolicy = config.ClientServerPolicy
envManager.Environment.SSLCACertificateFile = config.SSLCACertificateFile
envManager.Environment.SSLCACertificatePath = config.SSLCACertificatePath
envManager.Environment.EncryptionKeySize = config.EncryptionKeySize
envManager.Environment.EncryptionAlgorithm = config.EncryptionAlgorithm
envManager.Environment.EncryptionSaltSize = config.EncryptionSaltSize
Expand Down Expand Up @@ -471,6 +472,10 @@ func overwriteConfigToICommandsEnvMgr(envManager *irodsclient_icommands.ICommand
envManager.Environment.SSLCACertificateFile = config.SSLCACertificateFile
}

if len(config.SSLCACertificatePath) > 0 {
envManager.Environment.SSLCACertificatePath = config.SSLCACertificatePath
}

if config.EncryptionKeySize > 0 {
envManager.Environment.EncryptionKeySize = config.EncryptionKeySize
}
Expand Down Expand Up @@ -504,6 +509,7 @@ func setICommandsEnvMgrToConfig(config *Config, envManager *irodsclient_icommand
config.ClientServerNegotiation = envManager.Environment.ClientServerNegotiation
config.ClientServerPolicy = envManager.Environment.ClientServerPolicy
config.SSLCACertificateFile = envManager.Environment.SSLCACertificateFile
config.SSLCACertificatePath = envManager.Environment.SSLCACertificatePath
config.EncryptionKeySize = envManager.Environment.EncryptionKeySize
config.EncryptionAlgorithm = envManager.Environment.EncryptionAlgorithm
config.EncryptionSaltSize = envManager.Environment.EncryptionSaltSize
Expand Down Expand Up @@ -777,6 +783,10 @@ func PrintEnvironment() error {
"iRODS SSL CA Certification File",
envMgr.Environment.SSLCACertificateFile,
},
{
"iRODS SSL CA Certification Path",
envMgr.Environment.SSLCACertificatePath,
},
{
"iRODS SSL Encryption Key Size",
envMgr.Environment.EncryptionKeySize,
Expand Down
2 changes: 2 additions & 0 deletions commons/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Config struct {
ClientServerNegotiation string `yaml:"irods_client_server_negotiation,omitempty" envconfig:"IRODS_CLIENT_SERVER_NEGOTIATION"`
ClientServerPolicy string `yaml:"irods_client_server_policy,omitempty" envconfig:"IRODS_CLIENT_SERVER_POLICY"`
SSLCACertificateFile string `yaml:"irods_ssl_ca_certificate_file,omitempty" envconfig:"IRODS_SSL_CA_CERTIFICATE_FILE"`
SSLCACertificatePath string `yaml:"irods_ssl_ca_certificate_path,omitempty" envconfig:"IRODS_SSL_CA_CERTIFICATE_PATH"`
EncryptionKeySize int `yaml:"irods_encryption_key_size,omitempty" envconfig:"IRODS_ENCRYPTION_KEY_SIZE"`
EncryptionAlgorithm string `yaml:"irods_encryption_algorithm,omitempty" envconfig:"IRODS_ENCRYPTION_ALGORITHM"`
EncryptionSaltSize int `yaml:"irods_encryption_salt_size,omitempty" envconfig:"IRODS_ENCRYPTION_SALT_SIZE"`
Expand All @@ -47,6 +48,7 @@ func GetDefaultConfig() *Config {
ClientServerNegotiation: "",
ClientServerPolicy: ClientServerPolicyDefault,
SSLCACertificateFile: "",
SSLCACertificatePath: "",
EncryptionKeySize: EncryptionKeySizeDefault,
EncryptionAlgorithm: EncryptionAlgorithmDefault,
EncryptionSaltSize: SaltSizeDefault,
Expand Down

0 comments on commit 204b891

Please sign in to comment.