diff --git a/includes/mailchimp.inc b/includes/mailchimp.inc
index 89fda49..367dc6a 100644
--- a/includes/mailchimp.inc
+++ b/includes/mailchimp.inc
@@ -15,52 +15,85 @@ class MailChimp extends MCAPI {
     $protocol = $this->secure ? 'https://' : 'http://';
     $params["apikey"] = $this->api_key;
 
-    $this->errorMessage = "";
-    $this->errorCode = "";
-    $post_vars = http_build_query($params, NULL ,'&');
+    // Start forming the cURL request. This is used instead of
+    // drupal_http_request() as we need to support proxy requests for HTTPS POST
+    // requests, these can only be sent using the cURL option
+    // 'CURLOPT_HTTPPROXYTUNNEL'.
+    $params_query = http_build_query($params, NULL ,'&');
+    $headers[] = 'Content-type: application/x-www-form-urlencoded';
+    $headers[] = 'Content-Length: ' . strlen($params_query);
+    $headers[] = 'Accept-Language: ' . language_default()->language;
+    $headers[] = 'User-Agent: ' . 'MCAPI/' . $this->version;
 
-    $response = drupal_http_request(
-      $protocol . $host . $this->apiUrl["path"] . '?method=' . $method,
-      array(
-        'method' => 'POST',
-        'data' => $post_vars,
-        'headers' => array(
-          'Content-type' => 'application/x-www-form-urlencoded',
-          'Host' => $host,
-          'Accept-Language' => language_default()->language,
-          'User-Agent' => 'MCAPI/' . $this->version
-      ),
-      'timeout' => $this->getTimeout()
+    $request = curl_init();
+    curl_setopt($request, CURLOPT_URL, $protocol . $host . $this->apiUrl["path"] . '?method=' . $method);
+    curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
+    curl_setopt($request, CURLOPT_POST, 1);
+    curl_setopt($request, CURLOPT_POSTFIELDS, $params_query);
+    curl_setopt($request, CURLOPT_HEADER, 1);
+    curl_setopt($request, CURLOPT_HTTPHEADER, array(
+      'Accept-Language: ' . language_default()->language,
+      'User-Agent: ' . 'MCAPI/' . $this->version,
     ));
 
-    if (!empty($response->error)) {
-      $this->errorMessage = $response->error;
-      $this->errorCode = $response->code;
+    // Add outbound proxy connection settings if set.
+    $proxy_server = variable_get('proxy_server', '');
+    if ($proxy_server && _drupal_http_use_proxy($host)) {
+      curl_setopt($request, CURLOPT_PROXY, $proxy_server);
+      curl_setopt($request, CURLOPT_PROXYPORT, variable_get('proxy_port', ''));
+      curl_setopt($request, CURLOPT_HTTPPROXYTUNNEL, 1);
+    }
+
+    // Set the timeouts.
+    curl_setopt($request, CURLOPT_CONNECTTIMEOUT, $this->getTimeout());
+    curl_setopt($request, CURLOPT_TIMEOUT, $this->getTimeout());
+
+    // Execute the request.
+    if (!$response = curl_exec($request)) {
+      $this->errorMessage = curl_error($request);
+      $this->errorCode = -99;
+      curl_close($request);
       return FALSE;
     }
 
-    foreach($response->headers as $h){
-      if (substr($h,0,26)==="X-MailChimp-API-Error-Code"){
+    // Check the HTTP status for the response.
+    $info = curl_getinfo($request);
+    curl_close($request);
+    if ($info['http_code'] != 200) {
+      $this->errorMessage = curl_error($request);
+      $this->errorCode = $info['http_code'];
+      return FALSE;
+    }
+
+    // Get the headers and the response.
+    $response_parts = explode("\r\n\r\n", $response);
+    $body = array_pop($response_parts);
+    $headers = array_pop($response_parts);
+
+    // Check for MailChimp API errors in the headers.
+    foreach (explode("\n", $headers) as $i => $h) {
+      if (substr($h, 0, 26) === "X-MailChimp-API-Error-Code"){
         $this->errorMessage = "No error message was found";
-        $this->errorCode = trim(substr($h,27));
+        $this->errorCode = trim(substr($h, 27));
         return FALSE;
       }
     }
 
-    $return = drupal_json_decode($response->data);
-    if ($return === FALSE) {
-      $this->errorMessage = "Bad Response.  Got This: " . $response->data;
+    $json = drupal_json_decode($body);
+    if ($json === FALSE) {
+      $this->errorMessage = "Bad Response. Got This: " . $body;
       $this->errorCode = -99;
       return FALSE;
     }
 
-    if (isset($return['error']) && is_array($return)) {
-      $this->errorMessage = $return['error'];
-      $this->errorCode = $return['code'];
+    // Check for MailChimp API errors.
+    if (isset($json['error']) && is_array($json)) {
+      $this->errorMessage = $json['error'];
+      $this->errorCode = $json['code'];
       return FALSE;
     }
 
-    return $return;
+    return $json;
   }
 
 }
