mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-21 17:25:23 -04:00
Plugin installation fails in corporate proxy environment due to untrusted CA #131
Closed
opened 2026-02-16 00:20:01 -05:00 by yindo
·
6 comments
No Branch/Tag Specified
main
build/fix-serverless-runtime-error-propagation
gh-pages
build/test-document2
build/test-document
build/onboarding-ui
build/slim-extract
codex/depot-builds
codex/mac-runner-benchmark
feat/storage-path-prefix
feat/multi-db-user
feat/slim-action
deploy/dev
feat/dify-cli
feat/add-e2e
build/pg-bouncer
codex/add-multimodal-rerank-and-embedding-apis
refactor/local-runtime
build/multimodal-embeddings
codex/refactor-routine.submit-label-handling
codex/refactor-service-layer-based-on-provided-plan
feat/trigger-response
feat/trigger
build/trigger
deploy/trigger-dev
codex/remove-claude-code-reviewer-from-github-ci
codex/add-manifest-check-to-upload-endpoint
feat/no-root-dockerfile
fix/json-schema
fix/blocking-anthorized-langgenius
454-bump-cli-template
build/datasource
feat/datasource
bump-cloud-kit
feat/rag-tag
fix/change-session-not-found-to-400
feat/plugin-readme
add-claude-github-actions-1756274550417
docs/comprehensive-development-documentation
chore/remove-json-schema-validation-error
71cef04
fix/missing-parameter-type
fix/sessions-log
fix/template.env
bump/go-git
build/oauth
feat/oauth-refresh-token
feat/plugin-oauth
feat/tool-oauth-cli
build/plugin-oauth
feat/readme-i18n
fix/memory-leak
feat/icon-dark
feat/default-icon
plugin_launch_concurent
feat/collect-active-requests
feat/dark-icon
feat/support-structured-llm-output
feat/dynamic-selector
fix/reduce-logs
feat/decode-plugin-package
feat/db-extras
fix/backwards-invocation-overflow
feat/length-prefixed-chunking
fix/http-request-reader-header
chore/unify-configurations
fix/hardcoded-serverless-runtime-timeout
fix/cmd
fix/signature
refactor/implement-gen-routes
fix/redis-lock
refactor/codegen
feat/add-authorized-category
chore/style
feat/run-plugin-cli
reduce/run-once
feat/reinstall-serverless-runtime
feat/support-setup-process
fix/apply-stdio-buffer-size
chore/add-warning-messages-to-installed-bucket
feat/repo
enhance/stdio
feat/make-buffer-size-configurable
fix/moderation-init
fix/only-validate-profile-on-quick-mode
feat/support-quick-init-plugins
refactor/oauth-parameters
feat/oauth
refactor/simplify-plugin-invocation
test/integration-test-for-plugins
fix/backwards-compatible-to-llm-result-chunk
feat/auto-scale
enhance/reduce-ci-tests
fix/cli-ci
enhance/removes-llm-result-prompt-messages
fix/disable-benchmark-logs
benchmark/local-runtime
chore/remove-useless-benchmark
feat/benchmark
feat/fetch-app-info
fix/windows-remap-assets
fix/skip-hidden-file
feat/stream-tool-blob-message
fix/path-travel
feat/template-add-ci
enhance/version-compare
feat/sign-apple-os-cli
feat/support-minimal-dify-version-required
refactor/stdip
feat/add-serverless-connector-launching-timeout
fix/remove-prompt_messages-from-llm-result-chunk
feat/standardize-plugin-sdk-versions
chore/update-docs-and-refine-wording
update/readme-cli
fix/infinity-environment-setup
fix/cbor-unmarshaling
fix/use-aws-iam-baseendpoint
fix/lost-query-params-in-endpoint
fix/tiktoken
cohre/update-readme
fix/redis-tests
fix/friendly-identity
fix/marshal-any-map
chore/upgrade-ants
fix/graceful-precompile
enhance/tiktoken
feat/graceful-shutdown
fix/close-serverless-response
fix/correct-cli-guide
fix/plugin-active-log
fix/remove-proxy-args-from-uv
fix/endpoint-hook-url
fix/ci-credentials
feat/disable-gevent
fix/add-gcc
fix/hardcoded-endpoint-timeout
fix/bump-cli-sdk-version
fix/deadloop-when-redis-disconnect
fix/enhence/speed-up-environment-setup
enhance/introduce-uv
fix/change-default-db
fix/deadlock
readme
chore/env.example
feat/add-action-in-url
fix/add-more-pip-args
fix/optimize-local-heartbeat
optimize/db-init
fix/optimize-internal-server-error
fix/increase-default-plugin-max-execution-timeout
fix/force-patch-older-version
enhance/increase-installing-process
LICENSE
fix/set-user-id-to-unrequired
fix/max-launching-concurrent
improve/error-handing-in-serverless
refactor/json-unmarshaler-enhancement
fix/add-pip-mirror-url
enhance/serverless-connector
0.6.5
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.9
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.3
0.3.2
0.3.1
0.3.0
0.3.0b1
0.2.0
0.1.3
0.1.2
0.1.1
0.1.0
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
0.0.1-beta.23
0.0.1-beta.22
0.0.1-beta.21
0.0.1-beta.20
0.0.1-beta.19
0.0.1-beta.18
0.0.1-beta.17
0.0.1-beta.16
0.0.1-beta.15
0.0.1-beta.14
0.0.1-beta.13
0.0.1-beta.12
0.0.1-beta.11
0.0.1-beta.10
0.0.1-beta.9
0.0.1-beta.8
0.0.1-beta.7
0.0.1-beta.6
0.0.1-beta.5
0.0.1-beta.4
0.0.1-beta.3
0.0.1-beta.2
0.0.1-beta.1
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: langgenius/dify-plugin-daemon#131
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking 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 @Yukawa111 on GitHub (Jun 5, 2025).
Originally assigned to: @Yeuoly on GitHub.
Self Checks
Dify version
api: 1.4.1 plugin_daemon: 0.1.1-local
Cloud or Self Hosted
Self Hosted (Source), Self Hosted (Docker)
Steps to reproduce
1. Environment
2. Problem Description
When trying to install any plugin from the marketplace (e.g., Azure OpenAI), the installation fails with the error:
Reached maximum retries (3) for URL https://marketplace.dify.ai/api/v1/plugins/download?...This is caused by an SSL certificate verification error because the container does not trust the corporate proxy's root CA.
3. Extensive Troubleshooting Steps Taken
We have tried extensive steps to resolve this by installing the custom CA certificate into the containers. The key steps include:
entrypointscript for theapi,worker, andplugin_daemonservices indocker-compose.yaml..pemfile) to/usr/local/share/ca-certificates/custom_certs/and renames it with a.crtextension.update-ca-certificates.api,worker,plugin_daemon) confirm that the certificate was successfully added (1 added, 0 removed; done.).plugin_daemonservice, pointing to the newly installed certificate:PIP_CERTREQUESTS_CA_BUNDLECURL_CA_BUNDLESSL_CERT_FILEdify_plugindatabase creation).4. Final Diagnosis: The Container Environment is Correctly Configured
After all the above fixes, the Dify application still fails with the same error.
However, a manual test from within the
plugin_daemoncontainer proves that the container's OS and networking stack are correctly configured and trust the custom CA.The following command, executed inside the
plugin_daemoncontainer, succeeds perfectly:docker exec -it <plugin_daemon_container> curl -v https://marketplace.dify.aiOutput of successful
curl -vcommand:Host marketplace.dify.ai:443 was resolved.
IPv4: 104.26.9.156, 104.26.8.156, 172.67.71.187
Trying 104.26.9.156:443...
Connected to marketplace.dify.ai (104.26.9.156) port 443
ALPN: curl offers h2,http/1.1
CAfile: /usr/local/share/ca-certificates/custom_certs/netskope-cert-bundle.crt
CApath: /etc/ssl/certs ...
issuer: emailAddress=certadmin@netskope.com; CN=ca.ppcd-netskope-tenant.goskope.com; O=PayPay Card Corporation; L=Chiyoda; ST=TYO; C=JP
SSL certificate verify ok. ... < HTTP/1.1 200 OK ... (HTML content follows)
Conclusion
The
curltest proves that the container's system-level trust store is working correctly. The issue seems to be that theplugin_daemonGo application is not using the system's CA certificate store and is therefore unable to verify the HTTPS connection through our corporate proxy.Could you please advise if there is a specific, undocumented environment variable or another method to make the Dify Go application trust a custom CA certificate? Thank you.
✔️ Expected Behavior
After correctly configuring the container environment to trust our corporate proxy's custom CA certificate, I expected to be able to successfully install plugins (e.g., Azure OpenAI) from the Dify marketplace. The download should complete without any network or SSL/TLS errors.
❌ Actual Behavior
The plugin installation fails with a timeout error. The UI shows an error toast with the message: "Reached maximum retries (3) for URL https://marketplace.dify.ai/api/v1/plugins/download?..."
This failure occurs even though the container's OS-level tools (like
curl) can connect to this URL successfully with proper certificate verification, as proven in the "Steps to reproduce" section above.@dosubot[bot] commented on GitHub (Jun 5, 2025):
Hi @Yukawa111! I'm Dosu and I’m helping the dify team.
Based on what I found, there isn't a documented or undocumented environment variable in Dify to make the Go-based plugin_daemon trust a custom CA certificate. The Dify codebase does not expose Go source or provide a way to override or inject custom CA certs for the Go application; it relies on the system CA store bundled with the Docker image used for plugin_daemon and sandbox services. All SSL/TLS configuration in the repo is for NGINX as a reverse proxy, not for the Go containers themselves, and the plugin_daemon service's environment variables do not include any for custom CA handling reference.
If your custom CA is present in
/etc/ssl/certs/ca-certificates.crtinside the container, but the Go application still doesn't trust it, it's likely because the base image forlanggenius/dify-plugin-daemonwas built without your CA. In this case, you may need to build a custom image for plugin_daemon that includes your CA at build time, ensuring the Go runtime picks it up. There is no Dify-specific override for this; it's a limitation of how Go statically loads CA certs from the system at process start.If you need more detailed steps on how to build a custom Docker image for plugin_daemon with your CA, let me know!
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@crazywoola commented on GitHub (Jun 6, 2025):
https://github.com/langgenius/dify/blob/92614765ff280bbc5e7958abef2ff9c9e9e05cb4/docker/docker-compose.yaml#L660
Can you provide the env settings regarding the
plugin_daemon.@Yukawa111 commented on GitHub (Jun 6, 2025):
Hello, thank you for your previous suggestions.
I have now tried every possible solution, including building a custom Docker image for the
plugin_daemonservice as you recommended.Final Attempt: Building a Custom Image
Dockerfileforplugin_daemonthat useslanggenius/dify-plugin-daemon:0.1.1-localas a base.DockerfileCOPYs our corporate root CA (.pemfile) into the image and thenRUNsupdate-ca-certificates.docker compose up -d --buildcommand completes successfully. The build log confirms that theCOPYandRUN update-ca-certificatessteps are executed flawlessly.docker-compose.yamlfor theplugin_daemonwas updated to usebuild: ...instead ofimage:.api,worker) were also configured with a runtimeentrypointscript to install the certificate, and their logs confirm1 added, 0 removed; done.The Result: Still Failing
Even with the certificate baked into the
plugin_daemonimage at build time, the application still fails with the exact same error:Reached maximum retries (3) for URL https://marketplace.dify.ai/api/v1/plugins/download?...The logs for the
plugin_daemoncontainer now show a clean startup, with no certificate script running (as expected), but the UI error persists.Final Conclusion
This, combined with the successful
curl -vtest from my original report, is definitive proof that the Difyplugin_daemonGo application is fundamentally ignoring the operating system's certificate trust store, no matter how or when the custom CA is installed.This appears to be a hard limitation or a bug in the application that makes it unusable in any environment that requires a custom root CA for HTTPS inspection.
Could the development team please acknowledge this issue and suggest a workaround or a plan for a fix? Without a solution, we cannot use Dify's plugin features.
I have a major update. This is the final piece of evidence.
I temporarily disabled my corporate proxy (Netskope), and the plugin installation SUCCEEDED.
This definitively proves that the root cause of the
Reached maximum retrieserror is the SSL certificate interception by the proxy.The current situation is:
curl -vworks perfectly.No such file or directoryappears when configuring the API key, but this is a separate issue that only occurs after a successful installation).This confirms that the
plugin_daemonGo application is ignoring the system's CA trust store and is unable to function behind a corporate proxy that performs HTTPS inspection.Could the development team please investigate this and provide a solution? Without a fix, it seems Dify cannot be used in such network environments. Thank you.
@Yukawa111 commented on GitHub (Jun 6, 2025):
Hi @crazywoola,
Thank you for looking into my issue. Here are the final environment settings for the plugin_daemon service from my docker-compose.yaml, including the variables we added to try and fix the CA issue.
YAML
However, I have a major update which I posted in a separate comment just now. I believe this new information is the key to solving this issue.
In summary, I was able to prove that:
A manual curl -v from inside the plugin_daemon container works perfectly and verifies the custom CA.
Temporarily disabling my corporate proxy allows the plugin installation to succeed.
This strongly suggests the issue is not with my environment variables, but with the plugin_daemon Go application itself ignoring the system's CA trust store.
Could you please take a look at my latest comment with the full details?
Thank you again for your help!
@crazywoola commented on GitHub (Jun 6, 2025):
@Yukawa111 Thanks for the detailed investigation.
I will transfer this issue to this repo instead.
I think we might need some insights from @Yeuoly
@Yukawa111 commented on GitHub (Jun 6, 2025):
Hello @dosu ,@crazywoola and @Yeuoly
Success! I have finally resolved all the issues.
Thank you so much for your time and suggestions. I was able to find the final pieces of the puzzle and get Dify working perfectly behind our corporate proxy.
For anyone else facing this issue in the future, here is the complete, working solution. The key was that there were two separate problems that required two different solutions: one for the Go-based plugin_daemon and another for the Python-based api and worker services.
Final Solution
Problem 1: plugin_daemon (Go service) ignores runtime CA updates.
As @dosu correctly pointed out, this service seems to load its CAs at build time. The solution was to build a custom image.
This file bakes the custom CA certificate into the image.
Dockerfile
Base image
FROM langgenius/dify-plugin-daemon:0.1.1-local
Copy the real certificate PEM file into the image as a .crt file
COPY ./netskope-cert-bundle.pem /usr/local/share/ca-certificates/netskope-cert-bundle.crt
Run update-ca-certificates during the image build
RUN update-ca-certificates
(You also need to place netskope-cert-bundle.pem inside the custom-plugin-daemon folder.)
This uses the new Dockerfile to build the image and removes the now-unnecessary entrypoint and certificate volume.
YAML
Problem 2: api & worker (Python services) ignore the OS trust store and use certifi.
My logs revealed that these services were ignoring the system CA store (even after update-ca-certificates succeeded) and were exclusively using the CA bundle provided by the Python certifi package.
This script updates both the OS store AND appends the custom CA to the certifi bundle at container startup.
Bash
This uses the wrapper script as the new entrypoint.
YAML
With these combined solutions, Dify is now fully functional behind our corporate proxy. Plugin installation and model provider configuration both work flawlessly.
Thank you again for your guidance, which pointed me in the right direction. I believe this issue can now be closed.