<!-- <param name="ssl-key-password" value="MyPrivateKeyPassword"/> -->
<!-- optional timeout -->
<!-- <param name="timeout" value="10"/> -->
+ <!-- optional: maximum amount of time in seconds that is allowed to make the connection to the server -->
+ <!-- <param name="connect-timeout" value="2"/> -->
<!-- optional: use a custom CA certificate in PEM format to verify the peer
with. This is useful if you are acting as your own certificate authority.
<!-- <param name="ssl-key-password" value="MyPrivateKeyPassword"/> -->
<!-- optional timeout -->
<!-- <param name="timeout" value="10"/> -->
+ <!-- optional: maximum amount of time in seconds that is allowed to make the connection to the server -->
+ <!-- <param name="connect-timeout" value="2"/> -->
<!-- optional: use a custom CA certificate in PEM format to verify the peer
with. This is useful if you are acting as your own certificate authority.
disable-100-continue : <true|false> true Disable the 100 continue feature.
method : <string> "" METHOD name to send.
timeout : <number> 0 Timeout waiting for response.
+connect-timeout : <number> 0 Timeout to create connection. Use default value 0 to switch to the
+ default built-in connection timeout - 300 seconds.
enable-cacert-check : <true|false> false Check CA/CERT.
ssl-cert-path : <string> "" path to file.
ssl-key-path : <string> "" path to file.
switch_hash_t *vars_map;
long auth_scheme;
int timeout;
+ int connect_timeout;
profile_perms_t perms;
char *ua;
switch_curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, client->profile->timeout);
}
+ if (client->profile->connect_timeout) {
+ switch_curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, client->profile->connect_timeout);
+ }
+
if (client->profile->ssl_cert_file) {
switch_curl_easy_setopt(curl_handle, CURLOPT_SSLCERT, client->profile->ssl_cert_file);
}
char *method = NULL;
int disable100continue = 1;
int timeout = 0;
+ int connect_timeout = 0;
uint32_t enable_cacert_check = 0;
char *ssl_cert_file = NULL;
char *ssl_key_file = NULL;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't set a negative timeout!\n");
}
+ } else if (!strcasecmp(var, "connect-timeout")) {
+ int tmp = atoi(val);
+ if (tmp >= 0) {
+ connect_timeout = tmp;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't set a negative connect-timeout!\n");
+ }
} else if (!strcasecmp(var, "enable-cacert-check") && switch_true(val)) {
enable_cacert_check = 1;
} else if (!strcasecmp(var, "ssl-cert-path")) {
profile->auth_scheme = auth_scheme;
profile->timeout = timeout;
+ profile->connect_timeout = connect_timeout;
profile->url = switch_core_strdup(globals.pool, url);
switch_assert(profile->url);
switch_curl_easy_setopt(curl_handle, CURLOPT_TIMEOUT, client->profile->timeout);
}
+ if (client->profile->connect_timeout) {
+ switch_curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, client->profile->connect_timeout);
+ }
+
if (client->profile->ssl_cert_file) {
switch_curl_easy_setopt(curl_handle, CURLOPT_SSLCERT, client->profile->ssl_cert_file);
}