Please enter Certificate: Press <Enter> when done
-----BEGIN CERTIFICATE-----
MIIFtjCCBJ6gAwIBAgIQIFUz8E8mut6Vrn5LtX6fujANBgkqhkiG9w0BAQUFADBi
IPFnu2NdIr8HG9qX9exCghK4VUD7Dk6CdCY=
-----END CERTIFICATE-----
Please enter Private Key: Press <Enter> when done
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAyyRe6tHM1zq+rZk8DSX9ej1u17sCVydi6ijkzdYTTUth6fmN
-----END CERTIFICATE-----
Please enter certificates of Certification Authorities (CA) which form
+ the
certificate chain of the server certificate. This starts with the issu
+ing CA
certificate of the server certificate and can range up to the root CA
certificate.
Do you want to continue entering root and/or intermediate certificates
{y|n}: y
Please enter Intermediate Certificate: Press <Enter> when done
-----BEGIN CERTIFICATE-----
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
-----END CERTIFICATE-----
Do you want to continue entering root and/or intermediate certificates
{y|n}: y
Please enter Intermediate Certificate: Press <Enter> when done
-----BEGIN CERTIFICATE-----
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
-----END CERTIFICATE-----
Do you want to continue entering root and/or intermediate certificates
{y|n}: n
Code used :
my $certificate = $opts{certificate};
my $private_key = $opts{'private-key'};
my $intermediate_key = $opts{'intermediate-key'};
$prompt_answers = [
'Please enter Certificate:.*' => $certificate,
'Please enter Private Key:.*' => $private_key,
'Please enter certificates of Certification Authorities.*'
+ =>
( defined $intermediate_key ) ? $intermediate_key : 'n
+',
];
This code was effective till the response passed was 'n' for prompt 'D
+o you want to continue entering root and/or intermediate certificates
+', but not effective if the intermediate certificate chain is provide
+d.
The no. of 'intermediate certificates' prompt may vary depending upon the no of 'intermediate certificates' passed.
I want to handle this intermediate certificate chain scenario.