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 = {
615
615
checkPrivateKey : ( private_key ) => {
616
616
return tempWrite ( private_key , '/tmp' )
617
617
. 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
+ } ) ;
630
638
} ) ;
631
639
} ,
632
640
Original file line number Diff line number Diff line change 129
129
< / div>
130
130
< % } else if (provider === ' other' ) { % >
131
131
<!-- 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>
132
135
< div class = " col-sm-12 col-md-12" >
133
136
< div class = " form-group" >
134
137
< label class = " form-label" >< %- i18n (' str' , ' name' ) % > < span class = " form-required" > * < / span>< / label>
Original file line number Diff line number Diff line change 112
112
"stored-as-plaintext-info" : " This data will be stored as plaintext in the database and in a file!" ,
113
113
"propagation-seconds" : " Propagation Seconds" ,
114
114
"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."
116
117
},
117
118
"proxy-hosts" : {
118
119
"title" : " Proxy Hosts" ,
You can’t perform that action at this time.
0 commit comments