gptapi commited on
Commit
9acad74
·
verified ·
1 Parent(s): 29481d9

Create load-ca.sh

Browse files
Files changed (1) hide show
  1. load-ca.sh +17 -0
load-ca.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+ # 将环境变量中的证书内容写入文件
4
+ echo "$CA_CERT_CONTENT" | sed 's/\\n/\n/g' > /certs/custom/db-ca.crt
5
+
6
+ # 验证证书有效性
7
+ if ! openssl x509 -in /certs/custom/db-ca.crt -noout; then
8
+ echo "Invalid CA certificate format"
9
+ exit 1
10
+ fi
11
+
12
+ # 添加到系统信任链
13
+ cp /certs/custom/db-ca.crt /usr/local/share/ca-certificates/
14
+ update-ca-certificates
15
+
16
+ # 执行原始ENTRYPOINT
17
+ exec "$@"