Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { ERRORS } from '../../../../ssl/zerossl/validateZeroSslCertificateFactor
* @param {VerificationServer} verificationServer
* @param {HomeDir} homeDir
* @param {validateZeroSslCertificate} validateZeroSslCertificate
* @param {ConfigFileJsonRepository} configFileRepository
* @param {ConfigFile} configFile
* @return {obtainZeroSSLCertificateTask}
*/
export default function obtainZeroSSLCertificateTaskFactory(
Expand All @@ -32,6 +34,8 @@ export default function obtainZeroSSLCertificateTaskFactory(
verificationServer,
homeDir,
validateZeroSslCertificate,
configFileRepository,
configFile,
) {
/**
* @typedef {obtainZeroSSLCertificateTask}
Expand Down Expand Up @@ -141,6 +145,9 @@ export default function obtainZeroSSLCertificateTaskFactory(
config.set('platform.gateway.ssl.enabled', true);
config.set('platform.gateway.ssl.provider', 'zerossl');
config.set('platform.gateway.ssl.providerConfigs.zerossl.id', ctx.certificate.id);

// Save config file
configFileRepository.write(configFile);
Comment thread
shumkov marked this conversation as resolved.
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ export default function validateZeroSslCertificateFactory(homeDir, getCertificat
}

if (['pending_validation', 'draft'].includes(data.certificate.status)) {
// Certificate is already created, so we just need to pass validation
// and download certificate file

// We need to download new certificate bundle
// We need to validate and download new certificate bundle
data.isBundleFilePresent = false;

return {
Expand All @@ -116,6 +113,9 @@ export default function validateZeroSslCertificateFactory(homeDir, getCertificat
};
}

// Certificate is already created at this point, so we just need to pass validation
// and download certificate file

if (data.certificate.status !== 'issued' || data.isExpiresSoon) {
// Certificate is going to expire soon, or current certificate is not valid
// we need to obtain a new one
Expand Down