Throw specific error on missing passphrase
So that client can retry with a passphrase.
This commit is contained in:
parent
b07ec88ff2
commit
ffcccb5420
|
@ -40,6 +40,9 @@ public class ConfigurationParser {
|
||||||
|
|
||||||
/// The file includes an unsupported option.
|
/// The file includes an unsupported option.
|
||||||
case unsupportedConfiguration(option: String)
|
case unsupportedConfiguration(option: String)
|
||||||
|
|
||||||
|
/// Passphrase required to decrypt private keys.
|
||||||
|
case encryptionPassphrase
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Result of the parser.
|
/// Result of the parser.
|
||||||
|
@ -215,7 +218,7 @@ public class ConfigurationParser {
|
||||||
let container = CryptoContainer(pem: currentBlock.joined(separator: "\n"))
|
let container = CryptoContainer(pem: currentBlock.joined(separator: "\n"))
|
||||||
if isEncrypted {
|
if isEncrypted {
|
||||||
guard let passphrase = passphrase else {
|
guard let passphrase = passphrase else {
|
||||||
unsupportedError = ParsingError.unsupportedConfiguration(option: "encrypted client certificate key (missing passphrase)")
|
unsupportedError = ParsingError.encryptionPassphrase
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in New Issue