I am trying to get the WPS module to work for Drupal Commerce but I am getting an error. After the payment is made in my logs I see.

Attempt to validate IPN failed with error -111: Connection refused

The code that this relates to in the pay pal module is:

// Process the HTTP request to validate the IPN.
$response = drupal_http_request($host, array('method' => 'POST', 'data' => implode('&', $variables)));

// If an error occurred during processing, log the message and exit.
if (property_exists($response, 'error')) {
  watchdog('commerce_paypal', 'Attempt to validate IPN failed with error @code: @error', array('@code' => $response->code, '@error' => $response->error), WATCHDOG_ERROR);
  return FALSE;

The $response has an error in it (Connection refused).

As I am using the sandbox the $host is https://www.sandbox.paypal.com/cgi-bin/webscr.

I can confirm that I do receive the IPN from PayPal (some dd() statements proved this), but when we check to see if PayPal sent it, the code falls over.

Any ideas what could be going wrong? I am preusming it is more likley to be enviromental rather than code.

1 Answer 1


This was an environmental problem. The Drupal server did not have a direct connection to the internet. Setting the proxy settings in settings.php got this to work.


In my case the settings I had to set were:

$conf['proxy_server'] = 'my server';
$conf['proxy_port'] = 1234; // port number

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.