langgenius / langgenius/dify-sandbox
env.sh does not copy /etc/ssl/cert.pem symbol link file
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 326
- Avg merge
- 56m
- Merged PRs (30d)
- 3
Description
When I set SYSTEM_LIB_REQUIREMENTS="/usr/lib/python3.14,/usr/lib,/etc/ssl,/etc/nsswitch.conf,/etc/hosts,/etc/resolv.conf,/etc/localtime,/usr/share/zoneinfo,/etc/timezone"
env.sh does not copy /etc/ssl/cert.pem symbol link file.
```
bash-5.3# ls -alh /var/sandbox/sandbox-python/etc/ssl/
total 24K
drwxr-xr-x 1 root root 4.0K Jun 30 10:42 .
drwxr-xr-x 1 root root 4.0K Jul 4 03:37 ..
drwxr-xr-x 1 root root 4.0K Jul 4 03:37 certs
bash-5.3# ls -alh /etc/ssl/**
-rw-r--r-- 1 root root 7.4K Jun 25 09:54 /etc/ssl/ca.cnf
lrwxrwxrwx 1 root root 25 Apr 17 19:14 /etc/ssl/cert.pem -> certs/ca-certificates.crt
/etc/ssl/certs:
total 232K
drwxr-xr-x 1 root root 4.0K Apr 17 19:14 .
drwxr-xr-x 1 root root 4.0K Jun 25 09:54 ..
lrwxrwxrwx 1 root root 19 Apr 17 19:14 ca-bundle.crt -> ca-certificates.crt
-rw-r--r-- 2 root root 212.7K Apr 17 19:14 ca-certificates.crt
```
It breaks python ssl library in sandbox. ssl can not set cafile(etc/ssl/cert.pem), cafile should follow symbol link, then set to /etc/ssl/certs/ca-certificates.crt
```
def main():
import ssl
return {
"result": str(ssl.get_default_verify_paths()),
}
```
```
{
"result": "DefaultVerifyPaths(cafile=None, capath='/etc/ssl/certs', openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/etc/ssl/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='/etc/ssl/certs')"
}
```
After I copy symbol link to sanbox-python directory. It works well.
```
bash-5.3# cp -a /etc/ssl/cert.pem /var/sandbox/sandbox-python/etc/ssl/
bash-5.3# ls -alh /var/sandbox/sandbox-python/etc/ssl/
total 24K
drwxr-xr-x 1 root root 4.0K Jul 4 03:48 .
drwxr-xr-x 1 root root 4.0K Jul 4 03:37 ..
lrwxrwxrwx 1 root root 25 Jul 4 03:48 cert.pem -> certs/ca-certificates.crt
drwxr-xr-x 1 root root 4.0K Jul 4 03:37 certs
```
```
{
"result": "DefaultVerifyPaths(cafile='/etc/ssl/cert.pem', capath='/etc/ssl/certs', openssl_cafile_env='SSL_CERT_FILE', openssl_cafile='/etc/ssl/cert.pem', openssl_capath_env='SSL_CERT_DIR', openssl_capath='/etc/ssl/certs')"
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Inspect env.sh and its handling of SYSTEM_LIB_REQUIREMENTS, focusing on symbolic links under /etc/ssl. Reproduce the issue with the Python ssl.get_default_verify_paths() example, then verify that the sandbox contains /etc/ssl/cert.pem as a symlink and Python resolves the cafile correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, shell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100