@cocreate/server 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.1.1](https://github.com/CoCreate-app/CoCreate-server/compare/v1.1.0...v1.1.1) (2024-01-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * return if ssl false ([500e7c7](https://github.com/CoCreate-app/CoCreate-server/commit/500e7c7898f3a3a5ecc676ca68cd105cc1f29a6f))
7
+
1
8
  # [1.1.0](https://github.com/CoCreate-app/CoCreate-server/compare/v1.0.2...v1.1.0) (2024-01-08)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/server",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "An intergration with Server and CoCreateJS.",
5
5
  "keywords": [
6
6
  "server",
package/src/index.js CHANGED
@@ -25,11 +25,10 @@ function loadCertificates(domain) {
25
25
  async function sniCallback(domain, cb) {
26
26
  try {
27
27
  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
33
32
  } catch (error) {
34
33
  console.error("Error in SNI callback for domain:", domain, error);
35
34
  cb(error); // handle error or use default context