Closed wayneg123 closed 1 month ago
Hello @wayneg123! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let's work together to solve this issue!
To resolve the 403 Forbidden error when making an HTTPS request to a non-standard port (5447) using the HTTP Request node or a Python script with the requests
library, you need to ensure that the request is properly authorized and that the server is configured to accept requests on that port.
Ensure that the authorization
configuration is correctly set. The default configuration in the provided code uses "type": "no-auth"
, which means no authorization is being used. If the server requires authorization, you need to update this configuration.
Example:
@classmethod
def get_default_config(cls) -> dict:
return {
"type": "http-request",
"config": {
"method": "get",
"authorization": {
"type": "basic", # or "bearer", "api-key", etc.
"username": "your_username",
"password": "your_password"
},
"body": {
"type": "none"
},
"timeout": {
**HTTP_REQUEST_DEFAULT_TIMEOUT.model_dump(),
"max_connect_timeout": MAX_CONNECT_TIMEOUT,
"max_read_timeout": MAX_READ_TIMEOUT,
"max_write_timeout": MAX_WRITE_TIMEOUT,
}
},
}
requests
LibraryEnsure that you are including the necessary headers and authorization in your request. Here is an example of how to do this:
import requests
url = "https://yourserver.com:5447/your-endpoint"
headers = {
"Authorization": "Bearer your_token", # or other authorization method
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
if response.status_code == 403:
print("Access forbidden: Check your authorization and server configuration.")
else:
print("Response:", response.content)
Make sure to replace "Bearer your_token"
with the appropriate authorization method required by your server [1].
To continue talking to Dosu, mention @dosu.
There are few options that you can choose. The simplest way is you can turn of the ssrf_proxy by setting
# SSRF Proxy server HTTP URL
SSRF_PROXY_HTTP_URL=http://ssrf_proxy:3128 => SSRF_PROXY_HTTP_URL=
# SSRF Proxy server HTTPS URL
SSRF_PROXY_HTTPS_URL=http://ssrf_proxy:3128 => SSRF_PROXY_HTTPS_URL=
Which will turn off the proxy.
Has the issue been resolved? I encountered the same problem, showing a 403 error.I think it's possible to add a parameter to ignore SSL in the HTTP request section.
I've found the solution. Simply add the following line to docker/ssrf_proxy/squid.conf.template
, and it works:
acl SSL_ports port YOUR_HTTPS_PORT
I've found the solution. Simply add the following line to
docker/ssrf_proxy/squid.conf.template
, and it works:acl SSL_ports port YOUR_HTTPS_PORT
then found issue:[SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (ssl.c:1007) help!
Self Checks
Dify version
0.6.14
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
The request should successfully connect to the server and retrieve the expected response
❌ Actual Behavior
The request returns a 403 Forbidden error code.