|
|
@@ -372,7 +372,7 @@ CURLcode Curl_close(struct Curl_easy **datap)
|
|
|
|
|
|
/* Detach connection if any is left. This should not be normal, but can be
|
|
|
the case for example with CONNECT_ONLY + recv/send (test 556) */
|
|
|
- Curl_detach_connnection(data);
|
|
|
+ Curl_detach_connection(data);
|
|
|
m = data->multi;
|
|
|
if(m)
|
|
|
/* This handle is still part of a multi handle, take care of this first
|
|
|
@@ -542,7 +542,7 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
|
|
|
set->ssl.primary.verifypeer = TRUE;
|
|
|
set->ssl.primary.verifyhost = TRUE;
|
|
|
#ifdef USE_TLS_SRP
|
|
|
- set->ssl.authtype = CURL_TLSAUTH_NONE;
|
|
|
+ set->ssl.primary.authtype = CURL_TLSAUTH_NONE;
|
|
|
#endif
|
|
|
set->ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
|
|
|
type */
|
|
|
@@ -859,7 +859,7 @@ void Curl_disconnect(struct Curl_easy *data,
|
|
|
|
|
|
/* temporarily attach the connection to this transfer handle for the
|
|
|
disconnect and shutdown */
|
|
|
- Curl_attach_connnection(data, conn);
|
|
|
+ Curl_attach_connection(data, conn);
|
|
|
|
|
|
if(conn->handler->disconnect)
|
|
|
/* This is set if protocol-specific cleanups should be made */
|
|
|
@@ -868,7 +868,7 @@ void Curl_disconnect(struct Curl_easy *data,
|
|
|
conn_shutdown(data, conn);
|
|
|
|
|
|
/* detach it again */
|
|
|
- Curl_detach_connnection(data);
|
|
|
+ Curl_detach_connection(data);
|
|
|
|
|
|
conn_free(conn);
|
|
|
}
|
|
|
@@ -1020,12 +1020,12 @@ static bool extract_if_dead(struct connectdata *conn,
|
|
|
|
|
|
/* briefly attach the connection to this transfer for the purpose of
|
|
|
checking it */
|
|
|
- Curl_attach_connnection(data, conn);
|
|
|
+ Curl_attach_connection(data, conn);
|
|
|
|
|
|
state = conn->handler->connection_check(data, conn, CONNCHECK_ISDEAD);
|
|
|
dead = (state & CONNRESULT_DEAD);
|
|
|
/* detach the connection again */
|
|
|
- Curl_detach_connnection(data);
|
|
|
+ Curl_detach_connection(data);
|
|
|
|
|
|
}
|
|
|
else {
|
|
|
@@ -1100,6 +1100,12 @@ static void prune_dead_connections(struct Curl_easy *data)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static bool ssh_config_matches(struct connectdata *one,
|
|
|
+ struct connectdata *two)
|
|
|
+{
|
|
|
+ return (Curl_safecmp(one->proto.sshc.rsa, two->proto.sshc.rsa) &&
|
|
|
+ Curl_safecmp(one->proto.sshc.rsa_pub, two->proto.sshc.rsa_pub));
|
|
|
+}
|
|
|
/*
|
|
|
* Given one filled in connection struct (named needle), this function should
|
|
|
* detect if there already is one that has all the significant details
|
|
|
@@ -1356,6 +1362,11 @@ ConnectionExists(struct Curl_easy *data,
|
|
|
(data->state.httpwant < CURL_HTTP_VERSION_2_0))
|
|
|
continue;
|
|
|
|
|
|
+ if(get_protocol_family(needle->handler) == PROTO_FAMILY_SSH) {
|
|
|
+ if(!ssh_config_matches(needle, check))
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
if((needle->handler->flags&PROTOPT_SSL)
|
|
|
#ifndef CURL_DISABLE_PROXY
|
|
|
|| !needle->bits.httpproxy || needle->bits.tunnel_proxy
|
|
|
@@ -1508,7 +1519,7 @@ ConnectionExists(struct Curl_easy *data,
|
|
|
|
|
|
if(chosen) {
|
|
|
/* mark it as used before releasing the lock */
|
|
|
- Curl_attach_connnection(data, chosen);
|
|
|
+ Curl_attach_connection(data, chosen);
|
|
|
CONNCACHE_UNLOCK(data);
|
|
|
*usethis = chosen;
|
|
|
return TRUE; /* yes, we found one to use! */
|
|
|
@@ -1758,11 +1769,17 @@ static struct connectdata *allocate_conn(struct Curl_easy *data)
|
|
|
conn->ssl_config.verifystatus = data->set.ssl.primary.verifystatus;
|
|
|
conn->ssl_config.verifypeer = data->set.ssl.primary.verifypeer;
|
|
|
conn->ssl_config.verifyhost = data->set.ssl.primary.verifyhost;
|
|
|
+ conn->ssl_config.ssl_options = data->set.ssl.primary.ssl_options;
|
|
|
+#ifdef USE_TLS_SRP
|
|
|
+#endif
|
|
|
#ifndef CURL_DISABLE_PROXY
|
|
|
conn->proxy_ssl_config.verifystatus =
|
|
|
data->set.proxy_ssl.primary.verifystatus;
|
|
|
conn->proxy_ssl_config.verifypeer = data->set.proxy_ssl.primary.verifypeer;
|
|
|
conn->proxy_ssl_config.verifyhost = data->set.proxy_ssl.primary.verifyhost;
|
|
|
+ conn->proxy_ssl_config.ssl_options = data->set.proxy_ssl.primary.ssl_options;
|
|
|
+#ifdef USE_TLS_SRP
|
|
|
+#endif
|
|
|
#endif
|
|
|
conn->ip_version = data->set.ipver;
|
|
|
conn->bits.connect_only = data->set.connect_only;
|
|
|
@@ -3779,7 +3796,7 @@ static CURLcode create_conn(struct Curl_easy *data,
|
|
|
if(!result) {
|
|
|
conn->bits.tcpconnect[FIRSTSOCKET] = TRUE; /* we are "connected */
|
|
|
|
|
|
- Curl_attach_connnection(data, conn);
|
|
|
+ Curl_attach_connection(data, conn);
|
|
|
result = Curl_conncache_add_conn(data);
|
|
|
if(result)
|
|
|
goto out;
|
|
|
@@ -3848,7 +3865,8 @@ static CURLcode create_conn(struct Curl_easy *data,
|
|
|
data->set.str[STRING_SSL_ISSUERCERT_PROXY];
|
|
|
data->set.proxy_ssl.primary.issuercert_blob =
|
|
|
data->set.blobs[BLOB_SSL_ISSUERCERT_PROXY];
|
|
|
- data->set.proxy_ssl.CRLfile = data->set.str[STRING_SSL_CRLFILE_PROXY];
|
|
|
+ data->set.proxy_ssl.primary.CRLfile =
|
|
|
+ data->set.str[STRING_SSL_CRLFILE_PROXY];
|
|
|
data->set.proxy_ssl.cert_type = data->set.str[STRING_CERT_TYPE_PROXY];
|
|
|
data->set.proxy_ssl.key = data->set.str[STRING_KEY_PROXY];
|
|
|
data->set.proxy_ssl.key_type = data->set.str[STRING_KEY_TYPE_PROXY];
|
|
|
@@ -3856,18 +3874,20 @@ static CURLcode create_conn(struct Curl_easy *data,
|
|
|
data->set.proxy_ssl.primary.clientcert = data->set.str[STRING_CERT_PROXY];
|
|
|
data->set.proxy_ssl.key_blob = data->set.blobs[BLOB_KEY_PROXY];
|
|
|
#endif
|
|
|
- data->set.ssl.CRLfile = data->set.str[STRING_SSL_CRLFILE];
|
|
|
+ data->set.ssl.primary.CRLfile = data->set.str[STRING_SSL_CRLFILE];
|
|
|
data->set.ssl.cert_type = data->set.str[STRING_CERT_TYPE];
|
|
|
data->set.ssl.key = data->set.str[STRING_KEY];
|
|
|
data->set.ssl.key_type = data->set.str[STRING_KEY_TYPE];
|
|
|
data->set.ssl.key_passwd = data->set.str[STRING_KEY_PASSWD];
|
|
|
data->set.ssl.primary.clientcert = data->set.str[STRING_CERT];
|
|
|
#ifdef USE_TLS_SRP
|
|
|
- data->set.ssl.username = data->set.str[STRING_TLSAUTH_USERNAME];
|
|
|
- data->set.ssl.password = data->set.str[STRING_TLSAUTH_PASSWORD];
|
|
|
+ data->set.ssl.primary.username = data->set.str[STRING_TLSAUTH_USERNAME];
|
|
|
+ data->set.ssl.primary.password = data->set.str[STRING_TLSAUTH_PASSWORD];
|
|
|
#ifndef CURL_DISABLE_PROXY
|
|
|
- data->set.proxy_ssl.username = data->set.str[STRING_TLSAUTH_USERNAME_PROXY];
|
|
|
- data->set.proxy_ssl.password = data->set.str[STRING_TLSAUTH_PASSWORD_PROXY];
|
|
|
+ data->set.proxy_ssl.primary.username =
|
|
|
+ data->set.str[STRING_TLSAUTH_USERNAME_PROXY];
|
|
|
+ data->set.proxy_ssl.primary.password =
|
|
|
+ data->set.str[STRING_TLSAUTH_PASSWORD_PROXY];
|
|
|
#endif
|
|
|
#endif
|
|
|
data->set.ssl.key_blob = data->set.blobs[BLOB_KEY];
|
|
|
@@ -4006,7 +4026,7 @@ static CURLcode create_conn(struct Curl_easy *data,
|
|
|
* This is a brand new connection, so let's store it in the connection
|
|
|
* cache of ours!
|
|
|
*/
|
|
|
- Curl_attach_connnection(data, conn);
|
|
|
+ Curl_attach_connection(data, conn);
|
|
|
result = Curl_conncache_add_conn(data);
|
|
|
if(result)
|
|
|
goto out;
|
|
|
@@ -4153,7 +4173,7 @@ CURLcode Curl_connect(struct Curl_easy *data,
|
|
|
else if(result && conn) {
|
|
|
/* We're not allowed to return failure with memory left allocated in the
|
|
|
connectdata struct, free those here */
|
|
|
- Curl_detach_connnection(data);
|
|
|
+ Curl_detach_connection(data);
|
|
|
Curl_conncache_remove_conn(data, conn, TRUE);
|
|
|
Curl_disconnect(data, conn, TRUE);
|
|
|
}
|