@make-u-free/migi 0.3.0 → 0.3.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tls.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@make-u-free/migi",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Your AI right-hand agent. Works anywhere, with any LLM API.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tls.js CHANGED
@@ -41,13 +41,13 @@ if (caPath) {
41
41
 
42
42
  // ① tls.createSecureContext パッチ
43
43
  // Node 18+ built-in fetch (undici) を含む全TLS接続に効く
44
+ // デフォルトのCA(tls.rootCertificates)に追加する形にする
44
45
  const _origCreate = tls.createSecureContext
45
46
  tls.createSecureContext = (options = {}) => {
46
- const extra = [caCert]
47
- const existing = options.ca
47
+ const base = options.ca
48
48
  ? (Array.isArray(options.ca) ? options.ca : [options.ca])
49
- : []
50
- return _origCreate({ ...options, ca: [...existing, ...extra] })
49
+ : tls.rootCertificates // デフォルトCAを引き継ぐ
50
+ return _origCreate({ ...options, ca: [...base, caCert] })
51
51
  }
52
52
 
53
53
  // ② NODE_EXTRA_CA_CERTS(環境変数で起動する場合のフォールバック)
@@ -55,8 +55,8 @@ if (caPath) {
55
55
  process.env.NODE_EXTRA_CA_CERTS = caPath
56
56
  }
57
57
 
58
- // ③ https.Agent(node-fetch 系フォールバック)
59
- _httpsAgent = new https.Agent({ ca: caCert })
58
+ // ③ https.Agent: デフォルトCA + Zscaler CA を合わせて渡す
59
+ _httpsAgent = new https.Agent({ ca: [...tls.rootCertificates, caCert] })
60
60
 
61
61
  console.log(` [TLS] CA loaded: ${caPath}`)
62
62
  } else {