Skip to content

Commit 500e7c7

Browse files
committed
fix: return if ssl false
1 parent 42c8056 commit 500e7c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ function loadCertificates(domain) {
2525
async function sniCallback(domain, cb) {
2626
try {
2727
console.log('sni')
28-
await server.acme.checkCertificate(domain);
29-
30-
const sslContext = tls.createSecureContext(loadCertificates(domain));
31-
cb(null, sslContext);
32-
28+
if (await server.acme.checkCertificate(domain)) {
29+
const sslContext = tls.createSecureContext(loadCertificates(domain));
30+
cb(null, sslContext);
31+
} else return
3332
} catch (error) {
3433
console.error("Error in SNI callback for domain:", domain, error);
3534
cb(error); // handle error or use default context

0 commit comments

Comments
 (0)