@@ -53,11 +53,10 @@ import { SubjectOptions } from "../misc/subject";
5353import { CertificateStatus , Filename , KeySize , Thumbprint } from "../toolbox/common" ;
5454
5555import { debugLog , warningLog } from "../toolbox/debug" ;
56- import { make_path , mkdir } from "../toolbox/common2" ;
56+ import { make_path , mkdirSync } from "../toolbox/common2" ;
5757
5858import { CreateSelfSignCertificateParam , CreateSelfSignCertificateWithConfigParam } from "../toolbox/common" ;
59- import { createCertificateSigningRequestWithOpenSSL , dumpCertificate } from "../toolbox/with_openssl" ;
60- import { createSelfSignedCertificate } from "../toolbox/without_openssl" ;
59+ import { createCertificateSigningRequestAsync , createSelfSignedCertificate } from "../toolbox/without_openssl" ;
6160
6261import _simple_config_template from "./templates/simple_config_template.cnf" ;
6362/**
@@ -266,7 +265,7 @@ export class CertificateManager {
266265 this . location = make_path ( options . location , "" ) ;
267266 this . keySize = options . keySize ;
268267
269- mkdir ( options . location ) ;
268+ mkdirSync ( options . location ) ;
270269
271270 // istanbul ignore next
272271 if ( ! fs . existsSync ( this . location ) ) {
@@ -583,18 +582,18 @@ export class CertificateManager {
583582 private async _initialize ( ) : Promise < void > {
584583 assert ( ( this . state = CertificateManagerState . Initializing ) ) ;
585584 const pkiDir = this . location ;
586- mkdir ( pkiDir ) ;
587- mkdir ( path . join ( pkiDir , "own" ) ) ;
588- mkdir ( path . join ( pkiDir , "own/certs" ) ) ;
589- mkdir ( path . join ( pkiDir , "own/private" ) ) ;
590- mkdir ( path . join ( pkiDir , "rejected" ) ) ;
591- mkdir ( path . join ( pkiDir , "trusted" ) ) ;
592- mkdir ( path . join ( pkiDir , "trusted/certs" ) ) ;
593- mkdir ( path . join ( pkiDir , "trusted/crl" ) ) ;
594-
595- mkdir ( path . join ( pkiDir , "issuers" ) ) ;
596- mkdir ( path . join ( pkiDir , "issuers/certs" ) ) ; // contains Trusted CA certificates
597- mkdir ( path . join ( pkiDir , "issuers/crl" ) ) ; // contains CRL of revoked CA certificates
585+ mkdirSync ( pkiDir ) ;
586+ mkdirSync ( path . join ( pkiDir , "own" ) ) ;
587+ mkdirSync ( path . join ( pkiDir , "own/certs" ) ) ;
588+ mkdirSync ( path . join ( pkiDir , "own/private" ) ) ;
589+ mkdirSync ( path . join ( pkiDir , "rejected" ) ) ;
590+ mkdirSync ( path . join ( pkiDir , "trusted" ) ) ;
591+ mkdirSync ( path . join ( pkiDir , "trusted/certs" ) ) ;
592+ mkdirSync ( path . join ( pkiDir , "trusted/crl" ) ) ;
593+
594+ mkdirSync ( path . join ( pkiDir , "issuers" ) ) ;
595+ mkdirSync ( path . join ( pkiDir , "issuers/certs" ) ) ; // contains Trusted CA certificates
596+ mkdirSync ( path . join ( pkiDir , "issuers/crl" ) ) ; // contains CRL of revoked CA certificates
598597
599598 if ( ! fs . existsSync ( this . configFile ) || ! fs . existsSync ( this . privateKey ) ) {
600599 return await this . withLock2 ( async ( ) => {
@@ -705,7 +704,7 @@ export class CertificateManager {
705704 const now = new Date ( ) ;
706705 const today = now . toISOString ( ) . slice ( 0 , 10 ) + "_" + now . getTime ( ) ;
707706 const certificateSigningRequestFilename = path . join ( this . rootDir , "own/certs" , "certificate_" + today + ".csr" ) ;
708- await createCertificateSigningRequestWithOpenSSL ( certificateSigningRequestFilename , _params ) ;
707+ await createCertificateSigningRequestAsync ( certificateSigningRequestFilename , _params ) ;
709708 return certificateSigningRequestFilename ;
710709 } ) ;
711710 }
@@ -817,11 +816,7 @@ export class CertificateManager {
817816 wantedIssuerKey ,
818817 selectedTrustedCertificates . length ,
819818 ) ;
820- for ( const entry of selectedTrustedCertificates ) {
821- const data = await dumpCertificate ( entry . filename ) ;
822- debugLog ( " " , entry . filename ) ;
823- debugLog ( data ) ;
824- }
819+
825820 }
826821 return selectedTrustedCertificates . length > 0 ? selectedTrustedCertificates [ 0 ] . certificate : null ;
827822 }
0 commit comments