Index: usr/click/lib/libexauth/auth_ext.c
===================================================================
--- usr/click/lib/libexauth/auth_ext.c	(revision 38436)
+++ usr/click/lib/libexauth/auth_ext.c	(working copy)
@@ -230,10 +230,7 @@
 external_auth_one_ldaps(int server_num, char *username, char *password)
 {
     LDAP *ld;
-    struct timeval to;
     int msgid = 0;
-    to.tv_sec = 600;
-    to.tv_usec = 0;
     int ret_value = EXT_AUTH_FAILED;
     int i = server_num;
     LDAPMessage *answer, *entry;
@@ -269,6 +266,15 @@
     int version = LDAP_VERSION3;
     ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version);
 
+    struct timeval timeout = {10, 0}; // 10 seconds timeout
+    // Set network timeout
+    rc = ldap_set_option(ld, LDAP_OPT_NETWORK_TIMEOUT, &timeout);
+    if (rc != LDAP_OPT_SUCCESS) {
+        exau_log("ldap_set_option: %s\n", ldap_err2string(rc));
+        ldap_unbind_ext_s(ld, NULL, NULL);
+        return EXT_AUTH_FAILED;
+    }
+
     if (!g_exauth_conf.exauth_servers[i].verifyCert) {
         exau_log("Skip certificate verification\n");
         // Skip certificate verification
