 chr.admin.inc | 16 ++++++++++++----
 chr.module    |  6 +++++-
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/chr.admin.inc b/chr.admin.inc
index 61f4197ea..9554790e6 100644
--- a/chr.admin.inc
+++ b/chr.admin.inc
@@ -10,7 +10,7 @@
  */
 function chr_admin_settings_form($form, &$form_state) {
   $form['#access'] = array('administer chr');
-  
+
   $form['chr_override_drupal_http_request'] = array(
     '#type' => 'checkbox',
     '#title' => t('Override Drupal HTTP Request'),
@@ -18,7 +18,7 @@ function chr_admin_settings_form($form, &$form_state) {
     '#disabled' => !(VERSION >= 7.21),
     '#default_value' => variable_get('chr_override_drupal_http_request', FALSE),
   );
-  
+
   $form['chr_debug'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable Debug Output'),
@@ -27,6 +27,13 @@ function chr_admin_settings_form($form, &$form_state) {
     '#access' => module_exists('devel'),
   );
 
+  $form['chr_connection_timeout'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Connection timeout'),
+    '#description' => t('Curl connection timeout'),
+    '#default_value' => chr_connection_timeout(),
+  );
+
   // @todo add proxy settings (see README)
 
   $form['#submit'][] = 'chr_admin_settings_form_submit';
@@ -39,7 +46,7 @@ function chr_admin_settings_form($form, &$form_state) {
  */
 function chr_admin_settings_form_submit(&$form, &$form_state) {
   $values =& $form_state['values'];
-  
+
   // Check if override is enabled
   if ($values['chr_override_drupal_http_request'] == TRUE) {
     variable_set('chr_original_http_request_function_value', variable_get('drupal_http_request_function', FALSE));
@@ -49,4 +56,5 @@ function chr_admin_settings_form_submit(&$form, &$form_state) {
     // Restore original override
     variable_set('drupal_http_request_function', variable_get('chr_original_http_request_function_value', FALSE));
   }
-}
\ No newline at end of file
+  variable_set('chr_connection_timeout', $form_state['values']['chr_connection_timeout']);
+}
diff --git a/chr.module b/chr.module
index 51be995b5..1d989a961 100644
--- a/chr.module
+++ b/chr.module
@@ -113,7 +113,7 @@ function chr_curl_http_request($url, array $options = array()) {
     'method' => 'GET',
     'data' => NULL,
     'max_redirects' => 3,
-    'timeout' => 30.0,
+    'timeout' => chr_connection_timeout(),
     'context' => NULL,
     'verify_ssl' => FALSE,
     'verbose' => FALSE,
@@ -690,3 +690,7 @@ function chr_response_codes() {
     505 => 'HTTP Version not supported',
   );
 }
+
+function chr_connection_timeout() {
+  return variable_get('chr_connection_timeout', ini_get('default_socket_timeout') ?: 30);
+}
