mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-05-11 10:38:21 +00:00
Compare commits
3 commits
44c205d5a7
...
2ed9cda918
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2ed9cda918 | ||
![]() |
0273cee2ba | ||
![]() |
72cfd79b77 |
2 changed files with 5 additions and 5 deletions
|
@ -61,8 +61,8 @@ func init() {
|
|||
rootCmd.PersistentFlags().Duration("mfaDelay", time.Second*10, "Delay between MFA Attempts, only used in noninteractive modes")
|
||||
|
||||
rootCmd.PersistentFlags().Bool("tlsSkipVerify", false, "Allow servers with self-signed certificates")
|
||||
rootCmd.PersistentFlags().String("tlsClientPrivateKey", "", "Client private key for mtls")
|
||||
rootCmd.PersistentFlags().String("tlsClientCert", "", "Client certificate for mtls")
|
||||
rootCmd.PersistentFlags().String("tlsClientPrivateKeyFile", "", "Client private key for mtls")
|
||||
rootCmd.PersistentFlags().String("tlsClientCertFile", "", "Client certificate for mtls")
|
||||
|
||||
viper.BindPFlag("debug", rootCmd.PersistentFlags().Lookup("debug"))
|
||||
viper.BindPFlag("timeout", rootCmd.PersistentFlags().Lookup("timeout"))
|
||||
|
|
|
@ -17,12 +17,12 @@ func GetClientCertificate() (tls.Certificate, error) {
|
|||
return tls.Certificate{}, nil
|
||||
}
|
||||
if certExists && !keyExists {
|
||||
return tls.Certificate{}, fmt.Errorf("Client TLS private key is empty, but client TLS cert was sent.")
|
||||
return tls.Certificate{}, fmt.Errorf("Client TLS private key is empty, but client TLS cert was set.")
|
||||
}
|
||||
if !certExists && keyExists {
|
||||
return tls.Certificate{}, fmt.Errorf("Client TLS cert is empty, but client TLS private key was sent.")
|
||||
return tls.Certificate{}, fmt.Errorf("Client TLS cert is empty, but client TLS private key was set.")
|
||||
}
|
||||
return tls.LoadX509KeyPair("client.cert", "client-key.pem")
|
||||
return tls.LoadX509KeyPair(cert, key)
|
||||
}
|
||||
|
||||
func GetHttpClient() (*http.Client, error) {
|
||||
|
|
Loading…
Add table
Reference in a new issue