We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42c8056 commit 500e7c7Copy full SHA for 500e7c7
src/index.js
@@ -25,11 +25,10 @@ function loadCertificates(domain) {
25
async function sniCallback(domain, cb) {
26
try {
27
console.log('sni')
28
- await server.acme.checkCertificate(domain);
29
-
30
- const sslContext = tls.createSecureContext(loadCertificates(domain));
31
- cb(null, sslContext);
32
+ if (await server.acme.checkCertificate(domain)) {
+ const sslContext = tls.createSecureContext(loadCertificates(domain));
+ cb(null, sslContext);
+ } else return
33
} catch (error) {
34
console.error("Error in SNI callback for domain:", domain, error);
35
cb(error); // handle error or use default context
0 commit comments