1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-10 11:35:07 -05:00
curl/lib/vtls
Johannes Schindelin 1328f69d53
vtls: introduce curl_global_sslset()
Let's add a compile time safe API to select an SSL backend. This
function needs to be called *before* curl_global_init(), and can be
called only once.

Side note: we do not explicitly test that it is called before
curl_global_init(), but we do verify that it is not called multiple times
(even implicitly).

If SSL is used before the function was called, it will use whatever the
CURL_SSL_BACKEND environment variable says (or default to the first
available SSL backend), and if a subsequent call to
curl_global_sslset() disagrees with the previous choice, it will fail
with CURLSSLSET_TOO_LATE.

The function also accepts an "avail" parameter to point to a (read-only)
NULL-terminated list of available backends. This comes in real handy if
an application wants to let the user choose between whatever SSL backends
the currently available libcurl has to offer: simply call

	curl_global_sslset(-1, NULL, &avail);

which will return CURLSSLSET_UNKNOWN_BACKEND and populate the avail
variable to point to the relevant information to present to the user.

Just like with the HTTP/2 push functions, we have to add the function
declaration of curl_global_sslset() function to the header file
*multi.h* because VMS and OS/400 require a stable order of functions
declared in include/curl/*.h (where the header files are sorted
alphabetically). This looks a bit funny, but it cannot be helped.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2017-08-28 14:56:59 +02:00
..
axtls.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
axtls.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
cyassl.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
cyassl.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
darwinssl.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
darwinssl.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
gskit.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
gskit.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
gtls.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
gtls.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
mbedtls.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
mbedtls.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
nss.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
nssg.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
openssl.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
openssl.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
polarssl_threadlock.c Curl_polarsslthreadlock_thread_setup: clear array at init 2016-10-18 13:05:43 +02:00
polarssl_threadlock.h URLs: change all http:// URLs to https:// 2016-02-03 00:19:02 +01:00
polarssl.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
polarssl.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
schannel.c vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00
schannel.h vtls: fold the backend ID into the Curl_ssl structure 2017-08-28 14:56:58 +02:00
vtls.c vtls: introduce curl_global_sslset() 2017-08-28 14:56:59 +02:00
vtls.h vtls: refactor out essential information about the SSL backends 2017-08-28 14:56:58 +02:00