function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
raSFUserraSFUser 

http callout resulting in 403

Im hitting an issue calling a rest endpoint hosted internaly (but can be accessed externamly tested using postman), when preforming a callout from Salesforce apex i get the following error:

salesforce Unable to tunnel through proxy. Proxy returns HTTP/1.1 403 Forbidden

I have tested the endpoint using a variaty of aplications e.g. browsers, postman, java (camel routes) and encounter no issues, so the issue seems to be confined to Salesforce / setup.

The endpoint structure i am hitting is: https:/example.com:444/int/rest/users
 
private static HttpResponse callEndpont(String url, String method, String body, Integer timeout, Map<String,String> headers) {
        Http http = new Http();
        HttpRequest req = new HttpRequest();
        if (body != '') {
            req.setBody(body);
        }
        url = url.replace(' ', '%20');
        req.setEndpoint(url);
        req.setMethod(method);
        if (timeout != null) {
            req.setTimeout(timeout);
        }
        for (String key : headers.keySet()) {
            req.setHeader(key, headers.get(key));
        }
        
        HttpResponse resp;
        try {
            resp = http.send(req);
        }
        catch (Exception e) {
            throw new callException(e.getMessage());
        }
        
        return resp;
    }

Can anyone help me identify the problem here?

Thank you.
raSFUserraSFUser
I have checked and my user has the 'API Enabled' permission
Vivek Bobba 12Vivek Bobba 12

Hi there,

Did you get this issue resolved? Mine is almost the same scenario as yours.

Thank you,