mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
How does plugin-daemon use my own CA certificates? #360
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @skylinenzo on GitHub (Jun 11, 2025).
Self Checks
Dify version
1.3.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Hi, I have tried to deploy an air-gapped Dify behind proxy.
When I add Volcengine models with plugin, I encountered constantly 400 error from api server, as it says:
I set both extra env, volumes in docker-compose.yaml to apply the proxy settings and mount the CA certificates for the proxy:
I run
update-ca-certificatesand commit the API and plugin-daemon container locally, so next time I run this local container, it should has all my own CA certificates loaded.I am pretty sure the proxy is well set in both API and plugin-daemon container, as I can access to Internet and both API of volcengine with curl.
However, when I click on the Dify front end to set the model, it still return 400 error, so I use tcpdump and it says still unknown CA and reset the connection. And with Wireshark, I found the plugin-daemon tries to access the Internet with this HTTP packet:
My guess on the reason caused the problem is the plugin-daemon is accessing the internet with HTTP at 443 rather than HTTPS? That caused the CA certificates didn't mounted properly
✔️ Expected Behavior
The volcengine model should be properly added to Dify by plugin.
❌ Actual Behavior
See above.
@dosubot[bot] commented on GitHub (Jun 11, 2025):
The plugin-daemon uses the Python
requestslibrary for outbound HTTP(S) connections, which by default relies on the system CA certificates inside the container. There is no explicit code or configuration in Dify to customize CA certificate handling for the plugin-daemon—so it will only trust CAs that are available to the Python environment at runtime. If you want the plugin-daemon to use your own CA certificates, you need to ensure:REQUESTS_CA_BUNDLEis set to the path of your CA bundle (e.g.,/usr/local/share/ca-certificates/root_cert.crt) in the plugin-daemon container. This tellsrequeststo use your custom CA bundle for all HTTPS requests.update-ca-certificatesin the container to update the system trust store.Your Docker Compose should include the volume mount and the
REQUESTS_CA_BUNDLEenvironment variable. Example:If you’ve already done this and still see unknown CA errors, double-check that the CA file is readable inside the running container and that the path matches exactly. You can also test with a simple Python script using
requestsinside the container to verify SSL connections.The HTTP CONNECT method you see is normal for HTTPS over a proxy; it’s not an indication that the connection is downgraded to plain HTTP. The error likely means the CA bundle isn’t being picked up by the Python process, or the proxy is intercepting SSL and presenting a certificate not signed by your CA.
There is no Dify-specific configuration for CA certificates in the plugin-daemon; it relies entirely on the Python and OS-level trust settings. Any customization must be done via environment variables or by updating the container’s trust store.
Reference: plugin-daemon uses requests library and system CA certificates
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@skylinenzo commented on GitHub (Jun 11, 2025):
@dosu, still persist, "Connection error., request_id: 20250611072056BLXwWKNLvdJSaZwUwvbr"
@dosubot[bot] commented on GitHub (Jun 11, 2025):
The persistent connection error suggests the plugin-daemon still isn't trusting your custom CA, or there's a proxy-related issue. Here are some focused troubleshooting steps:
REQUESTS_CA_BUNDLE. You can exec into the container and runls -l /usr/local/share/ca-certificates/root_cert.crtand try a simple Pythonrequestscall to an HTTPS endpoint using your proxy.HTTP_PROXY,http_proxy,HTTPS_PROXY,https_proxy, andNO_PROXY,no_proxy) are set in your Docker Compose. Some Python libraries only pick up lowercase variants, especially in multi-layered Docker setups.unset HTTP_PROXYandunset HTTPS_PROXY) inside the container and see if the error changes—sometimes proxy settings can interfere with internal service calls or loopback addresses.If you’ve confirmed all of the above and still see the error, capturing the full error traceback from the plugin-daemon logs (not just the API) may reveal more about whether it’s a CA trust or proxy routing issue. The Dify codebase does not provide any plugin-daemon-specific CA or proxy configuration—everything is handled at the OS and environment variable level, so the fix will be in the container setup, not in Dify config files.
Reference: plugin-daemon uses requests library and system CA certificates
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
