[SSL: CERTIFICATE_VERIFY_FAILED] invoke models provided by openrouter and returned ssl error #13888

Closed
opened 2026-02-21 19:14:23 -05:00 by yindo · 5 comments
Owner

Originally created by @wingying on GitHub (May 14, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.3.1

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

I am trying to invoke models provided by openrouter, and get ssl certificate error.

Image

I am trying to set verify=False in /app/api/core/plugin/impl/base.py

Image

and rebuild langgenius/dify-api:1.3.1, docler-compose down and docker-compose up -d to restart related pods. but it is no use. I even cannot trace the latest error log from dify-api pod.

FROM langgenius/dify-api:1.3.1
COPY base.py /app/api/core/plugin/impl/base.py

Is there any other workaround to fix the issue?

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @wingying on GitHub (May 14, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3.1 ### Cloud or Self Hosted Cloud, Self Hosted (Docker) ### Steps to reproduce I am trying to invoke models provided by openrouter, and get ssl certificate error. ![Image](https://github.com/user-attachments/assets/7f71a9a0-4ab0-4d41-af26-3deddcd8c1eb) I am trying to set verify=False in /app/api/core/plugin/impl/base.py <img width="1210" alt="Image" src="https://github.com/user-attachments/assets/66140717-7cf8-41ce-9db1-f692267d2c01" /> and rebuild langgenius/dify-api:1.3.1, docler-compose down and docker-compose up -d to restart related pods. but it is no use. I even cannot trace the latest error log from dify-api pod. ``` FROM langgenius/dify-api:1.3.1 COPY base.py /app/api/core/plugin/impl/base.py ``` Is there any other workaround to fix the issue? ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the stale label 2026-02-21 19:14:23 -05:00
yindo closed this issue 2026-02-21 19:14:23 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 14, 2025):

I found a similar resolved issue that might help you address the SSL certificate verification error. The suggested solution involves configuring Dify to bypass SSL certificate verification by setting the HTTP_REQUEST_NODE_SSL_VERIFY configuration to False. You should modify the dify_config to set HTTP_REQUEST_NODE_SSL_VERIFY to "false". This will disable SSL certificate verification, which is useful for development purposes [1].

Additionally, ensure that the SERVICE_API_URL environment variable in Dify's .env file is set to use the HTTPS protocol, for example: SERVICE_API_URL=https://api.dify.ai [1].

After making these changes, restart the API container using the command:

docker restart docker-api-1

Also, ensure that the Authorization header is correctly formatted as 'Bearer ' to avoid any 403 Forbidden errors [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 14, 2025): <!-- Answer --> I found a similar resolved issue that might help you address the SSL certificate verification error. The suggested solution involves configuring Dify to bypass SSL certificate verification by setting the `HTTP_REQUEST_NODE_SSL_VERIFY` configuration to `False`. You should modify the `dify_config` to set `HTTP_REQUEST_NODE_SSL_VERIFY` to `"false"`. This will disable SSL certificate verification, which is useful for development purposes <sup>[[1]](https://github.com/langgenius/dify/issues/16417)</sup>. Additionally, ensure that the `SERVICE_API_URL` environment variable in Dify's `.env` file is set to use the HTTPS protocol, for example: `SERVICE_API_URL=https://api.dify.ai` <sup>[[1]](https://github.com/langgenius/dify/issues/16417)</sup>. After making these changes, restart the API container using the command: ```bash docker restart docker-api-1 ``` Also, ensure that the Authorization header is correctly formatted as 'Bearer <api-key>' to avoid any 403 Forbidden errors <sup>[[1]](https://github.com/langgenius/dify/issues/16417)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b026ff19-b2c4-4276-9afc-fec6c36e0fc3?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b026ff19-b2c4-4276-9afc-fec6c36e0fc3?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b026ff19-b2c4-4276-9afc-fec6c36e0fc3?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b026ff19-b2c4-4276-9afc-fec6c36e0fc3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b026ff19-b2c4-4276-9afc-fec6c36e0fc3?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/b026ff19-b2c4-4276-9afc-fec6c36e0fc3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b026ff19-b2c4-4276-9afc-fec6c36e0fc3?feedback_type=other)</sup>
Author
Owner

@wingying commented on GitHub (May 15, 2025):

I set the env HTTP_REQUEST_NODE_SSL_VERIFY to FALSE as well.
However, no use.

@wingying commented on GitHub (May 15, 2025): I set the env HTTP_REQUEST_NODE_SSL_VERIFY to FALSE as well. However, no use.
Author
Owner

@MrXionGe commented on GitHub (May 15, 2025):

I set the env HTTP_REQUEST_NODE_SSL_VERIFY to FALSE as well. However, no use.

@wingying
This configuration applies to HTTP nodes. The PLUGIN is not affected. It seems to be the case.

@MrXionGe commented on GitHub (May 15, 2025): > I set the env HTTP_REQUEST_NODE_SSL_VERIFY to FALSE as well. However, no use. @wingying This configuration applies to HTTP nodes. The PLUGIN is not affected. It seems to be the case.
Author
Owner

@wingying commented on GitHub (May 16, 2025):

yeah,at beginning,i already said even
I set verify=False in base.py _request function,and rebuild image and restart dify that is also no use.

发自我的 iPhone

在 2025年5月16日,09:49,大熊同学 @.***> 写道:


[https://avatars.githubusercontent.com/u/23261935?s=20&v=4]MrXionGe left a comment (langgenius/dify#19714)https://github.com/langgenius/dify/issues/19714#issuecomment-2885423573

I set the env HTTP_REQUEST_NODE_SSL_VERIFY to FALSE as well. However, no use.

@wingyinghttps://github.com/wingying
This configuration applies to HTTP nodes. The PLUGIN is not affected. It seems to be the case.


Reply to this email directly, view it on GitHubhttps://github.com/langgenius/dify/issues/19714#issuecomment-2885423573, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMZGSAVEI2WGH2H7CZ76Q6L26U7Y7AVCNFSM6AAAAAB5E6DO2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBVGQZDGNJXGM.
You are receiving this because you were mentioned.Message ID: @.***>

@wingying commented on GitHub (May 16, 2025): yeah,at beginning,i already said even I set verify=False in base.py _request function,and rebuild image and restart dify that is also no use. 发自我的 iPhone 在 2025年5月16日,09:49,大熊同学 ***@***.***> 写道:  [https://avatars.githubusercontent.com/u/23261935?s=20&v=4]MrXionGe left a comment (langgenius/dify#19714)<https://github.com/langgenius/dify/issues/19714#issuecomment-2885423573> I set the env HTTP_REQUEST_NODE_SSL_VERIFY to FALSE as well. However, no use. @wingying<https://github.com/wingying> This configuration applies to HTTP nodes. The PLUGIN is not affected. It seems to be the case. — Reply to this email directly, view it on GitHub<https://github.com/langgenius/dify/issues/19714#issuecomment-2885423573>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMZGSAVEI2WGH2H7CZ76Q6L26U7Y7AVCNFSM6AAAAAB5E6DO2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBVGQZDGNJXGM>. You are receiving this because you were mentioned.Message ID: ***@***.***>
Author
Owner

@dosubot[bot] commented on GitHub (Aug 26, 2025):

Hi, @wingying. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported an SSL certificate verification error when using openrouter models with Dify v1.3.1 on both cloud and Docker setups.
  • Attempts to disable SSL verification by modifying base.py and setting HTTP_REQUEST_NODE_SSL_VERIFY to false did not resolve the issue.
  • A contributor noted that the SSL verification setting only affects HTTP nodes, not plugins, indicating the problem is related to plugin requests.
  • You confirmed that disabling verification via code changes and environment variables has not fixed the error.

Next Steps:

  • Please check if this SSL verification issue still occurs with the latest version of Dify.
  • If it is still relevant, you can keep the discussion open by commenting on this issue; otherwise, I will automatically close it in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 26, 2025): Hi, @wingying. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported an SSL certificate verification error when using openrouter models with Dify v1.3.1 on both cloud and Docker setups. - Attempts to disable SSL verification by modifying `base.py` and setting `HTTP_REQUEST_NODE_SSL_VERIFY` to false did not resolve the issue. - A contributor noted that the SSL verification setting only affects HTTP nodes, not plugins, indicating the problem is related to plugin requests. - You confirmed that disabling verification via code changes and environment variables has not fixed the error. **Next Steps:** - Please check if this SSL verification issue still occurs with the latest version of Dify. - If it is still relevant, you can keep the discussion open by commenting on this issue; otherwise, I will automatically close it in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13888