File tree Expand file tree Collapse file tree 3 files changed +25
-13
lines changed Expand file tree Collapse file tree 3 files changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -615,18 +615,26 @@ const internalCertificate = {
615615 checkPrivateKey : ( private_key ) => {
616616 return tempWrite ( private_key , '/tmp' )
617617 . then ( ( filepath ) => {
618- let key_type = private_key . includes ( '-----BEGIN RSA' ) ? 'rsa' : 'ec' ;
619- return utils . exec ( 'openssl ' + key_type + ' -in ' + filepath + ' -check -noout 2>&1 ' )
620- . then ( ( result ) => {
621- if ( ! result . toLowerCase ( ) . includes ( 'key ok' ) && ! result . toLowerCase ( ) . includes ( 'key valid' ) ) {
622- throw new error . ValidationError ( 'Result Validation Error: ' + result ) ;
623- }
624- fs . unlinkSync ( filepath ) ;
625- return true ;
626- } ) . catch ( ( err ) => {
627- fs . unlinkSync ( filepath ) ;
628- throw new error . ValidationError ( 'Certificate Key is not valid (' + err . message + ')' , err ) ;
629- } ) ;
618+ return new Promise ( ( resolve , reject ) => {
619+ const failTimeout = setTimeout ( ( ) => {
620+ reject ( new error . ValidationError ( 'Result Validation Error: Validation timed out. This could be due to the key being passphrase-protected.' ) ) ;
621+ } , 10000 ) ;
622+ utils
623+ . exec ( 'openssl pkey -in ' + filepath + ' -check -noout 2>&1 ' )
624+ . then ( ( result ) => {
625+ clearTimeout ( failTimeout ) ;
626+ if ( ! result . toLowerCase ( ) . includes ( 'key is valid' ) ) {
627+ reject ( new error . ValidationError ( 'Result Validation Error: ' + result ) ) ;
628+ }
629+ fs . unlinkSync ( filepath ) ;
630+ resolve ( true ) ;
631+ } )
632+ . catch ( ( err ) => {
633+ clearTimeout ( failTimeout ) ;
634+ fs . unlinkSync ( filepath ) ;
635+ reject ( new error . ValidationError ( 'Certificate Key is not valid (' + err . message + ')' , err ) ) ;
636+ } ) ;
637+ } ) ;
630638 } ) ;
631639 } ,
632640
Original file line number Diff line number Diff line change 129129 < / div>
130130 < % } else if (provider === ' other' ) { % >
131131 <!-- Other -->
132+ < div class = " col-sm-12 col-md-12" >
133+ < div class = " text-blue mb-4" >< i class = " fe fe-alert-triangle" >< / i> < %= i18n (' ssl' , ' passphrase-protection-support-info' ) % >< / div>
134+ < / div>
132135 < div class = " col-sm-12 col-md-12" >
133136 < div class = " form-group" >
134137 < label class = " form-label" >< %- i18n (' str' , ' name' ) % > < span class = " form-required" > * < / span>< / label>
Original file line number Diff line number Diff line change 112112 "stored-as-plaintext-info" : " This data will be stored as plaintext in the database and in a file!" ,
113113 "propagation-seconds" : " Propagation Seconds" ,
114114 "propagation-seconds-info" : " Leave empty to use the plugins default value. Number of seconds to wait for DNS propagation." ,
115- "processing-info" : " Processing... This might take a few minutes."
115+ "processing-info" : " Processing... This might take a few minutes." ,
116+ "passphrase-protection-support-info" : " Key files protected with a passphrase are not supported."
116117 },
117118 "proxy-hosts" : {
118119 "title" : " Proxy Hosts" ,
You can’t perform that action at this time.
0 commit comments