Artifactspublic-v0

curl

master
ply4 git calls24 ms289 KiB3 cachedprotocol v2
141 lines4.2 KiBRaw

NAME

curl_global_sslset - select SSL backend to use

SYNOPSIS

c
#include <curl/curl.h>

CURLsslset curl_global_sslset(curl_sslbackend id,
                              const char *name,
                              const curl_ssl_backend ***avail);

DESCRIPTION

This function configures at runtime which SSL backend to use with libcurl. This function can only be used to select an SSL backend once, and it must be called before curl_global_init(3).

The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The backend can also be specified via the name parameter for a case insensitive match (passing CURLSSLBACKEND_NONE as id). If both id and name are specified, the name is ignored.

If neither id nor name are specified, the function fails with CURLSSLSET_UNKNOWN_BACKEND and set the avail pointer to the null-terminated list of available backends. The available backends are those that this particular build of libcurl supports.

Since libcurl 7.60.0, the avail pointer is always set to the list of alternatives if non-NULL.

Upon success, the function returns CURLSSLSET_OK.

If the specified SSL backend is not available, the function returns CURLSSLSET_UNKNOWN_BACKEND and sets the avail pointer to a null-terminated list of available SSL backends. In this case, you may call the function again to try to select a different backend.

The SSL backend can be set only once. If it has already been set, a subsequent attempt to change it results in a CURLSSLSET_TOO_LATE getting returned.

This function is thread-safe since libcurl 7.84.0 if curl_version_info(3) has the CURL_VERSION_THREADSAFE feature bit set (most platforms).

If this is not thread-safe, you must not call this function when any other thread in the program (i.e. a thread sharing the same memory) is running. This does not only mean no other thread that is using libcurl.

Names

SSL backend names (case-insensitive): GnuTLS, mbedTLS, OpenSSL, Rustls, Schannel, wolfSSL

The name "OpenSSL" is used for all versions of OpenSSL and its associated forks/flavors in this function. AmiSSL, AWS-LC, BoringSSL, LibreSSL, OpenSSL and quictls are all supported by libcurl, but in the eyes of curl_global_sslset(3) they are all called "OpenSSL". They all mostly provide the same API. curl_version_info(3) can return more specific info about the exact OpenSSL flavor and version number in use.

struct

c
typedef struct {
  curl_sslbackend id;
  const char *name;
} curl_ssl_backend;

typedef enum {
  CURLSSLBACKEND_NONE = 0,
  CURLSSLBACKEND_OPENSSL = 1, /* or one of its forks */
  CURLSSLBACKEND_GNUTLS = 2,
  CURLSSLBACKEND_NSS = 3,
  CURLSSLBACKEND_GSKIT = 5, /* deprecated */
  CURLSSLBACKEND_POLARSSL = 6, /* deprecated */
  CURLSSLBACKEND_WOLFSSL = 7,
  CURLSSLBACKEND_SCHANNEL = 8,
  CURLSSLBACKEND_SECURETRANSPORT = 9, /* deprecated */
  CURLSSLBACKEND_AXTLS = 10, /* deprecated */
  CURLSSLBACKEND_MBEDTLS = 11,
  CURLSSLBACKEND_MESALINK = 12, /* deprecated */
  CURLSSLBACKEND_BEARSSL = 13, /* deprecated */
  CURLSSLBACKEND_RUSTLS = 14
} curl_sslbackend;

%PROTOCOLS%

EXAMPLE

c
int main(void)
{
  const curl_ssl_backend **list;
  int i;
  /* choose a specific backend */
  curl_global_sslset(CURLSSLBACKEND_WOLFSSL, NULL, NULL);

  /* list the available ones */
  curl_global_sslset(CURLSSLBACKEND_NONE, NULL, &list);

  for(i = 0; list[i]; i++)
    printf("SSL backend #%d: '%s' (ID: %u)\n",
           i, list[i]->name, list[i]->id);
}

%AVAILABILITY%

RETURN VALUE

If this function returns CURLSSLSET_OK, the backend was successfully selected.

If the chosen backend is unknown (or support for the chosen backend has not been compiled into libcurl), the function returns CURLSSLSET_UNKNOWN_BACKEND.

If the backend had been configured previously, or if curl_global_init(3) has already been called, the function returns CURLSSLSET_TOO_LATE.

If this libcurl was built completely without SSL support, with no backends at all, this function returns CURLSSLSET_NO_BACKENDS.

1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: curl_global_sslset
5Section: 3
6Source: libcurl
7See-also:
8 - curl_global_init (3)
9 - libcurl (3)
10Protocol:
11 - All
12Added-in: 7.56.0
13---
15# NAME
17curl_global_sslset - select SSL backend to use
19# SYNOPSIS
21~~~c
22#include <curl/curl.h>
24CURLsslset curl_global_sslset(curl_sslbackend id,
25 const char *name,
26 const curl_ssl_backend ***avail);
27~~~
29# DESCRIPTION
31This function configures at runtime which SSL backend to use with
32libcurl. This function can only be used to select an SSL backend once, and it
33must be called **before** curl_global_init(3).
35The backend can be identified by the *id*
36(e.g. **CURLSSLBACKEND_OPENSSL**). The backend can also be specified via the
37*name* parameter for a case insensitive match (passing
38**CURLSSLBACKEND_NONE** as *id*). If both *id* and *name* are
39specified, the *name* is ignored.
41If neither *id* nor *name* are specified, the function fails with
42**CURLSSLSET_UNKNOWN_BACKEND** and set the *avail* pointer to the
43null-terminated list of available backends. The available backends are those
44that this particular build of libcurl supports.
46Since libcurl 7.60.0, the *avail* pointer is always set to the list of
47alternatives if non-NULL.
49Upon success, the function returns **CURLSSLSET_OK**.
51If the specified SSL backend is not available, the function returns
52**CURLSSLSET_UNKNOWN_BACKEND** and sets the *avail* pointer to a
53null-terminated list of available SSL backends. In this case, you may call the
54function again to try to select a different backend.
56The SSL backend can be set only once. If it has already been set, a subsequent
57attempt to change it results in a **CURLSSLSET_TOO_LATE** getting returned.
59This function is thread-safe since libcurl 7.84.0 if
60curl_version_info(3) has the CURL_VERSION_THREADSAFE feature bit set
61(most platforms).
63If this is not thread-safe, you must not call this function when any other
64thread in the program (i.e. a thread sharing the same memory) is running.
65This does not only mean no other thread that is using libcurl.
67# Names
69SSL backend names (case-insensitive): GnuTLS, mbedTLS, OpenSSL, Rustls,
70Schannel, wolfSSL
72The name "OpenSSL" is used for all versions of OpenSSL and its associated
73forks/flavors in this function. AmiSSL, AWS-LC, BoringSSL, LibreSSL, OpenSSL
74and quictls are all supported by libcurl, but in the eyes of
75curl_global_sslset(3) they are all called "OpenSSL". They all mostly provide
76the same API. curl_version_info(3) can return more specific info about the
77exact OpenSSL flavor and version number in use.
79# struct
81~~~c
82typedef struct {
83 curl_sslbackend id;
84 const char *name;
85} curl_ssl_backend;
87typedef enum {
88 CURLSSLBACKEND_NONE = 0,
89 CURLSSLBACKEND_OPENSSL = 1, /* or one of its forks */
90 CURLSSLBACKEND_GNUTLS = 2,
91 CURLSSLBACKEND_NSS = 3,
92 CURLSSLBACKEND_GSKIT = 5, /* deprecated */
93 CURLSSLBACKEND_POLARSSL = 6, /* deprecated */
94 CURLSSLBACKEND_WOLFSSL = 7,
95 CURLSSLBACKEND_SCHANNEL = 8,
96 CURLSSLBACKEND_SECURETRANSPORT = 9, /* deprecated */
97 CURLSSLBACKEND_AXTLS = 10, /* deprecated */
98 CURLSSLBACKEND_MBEDTLS = 11,
99 CURLSSLBACKEND_MESALINK = 12, /* deprecated */
100 CURLSSLBACKEND_BEARSSL = 13, /* deprecated */
101 CURLSSLBACKEND_RUSTLS = 14
102} curl_sslbackend;
103~~~
105# %PROTOCOLS%
107# EXAMPLE
109~~~c
110int main(void)
112 const curl_ssl_backend **list;
113 int i;
114 /* choose a specific backend */
115 curl_global_sslset(CURLSSLBACKEND_WOLFSSL, NULL, NULL);
117 /* list the available ones */
118 curl_global_sslset(CURLSSLBACKEND_NONE, NULL, &list);
120 for(i = 0; list[i]; i++)
121 printf("SSL backend #%d: '%s' (ID: %u)\n",
122 i, list[i]->name, list[i]->id);
124~~~
126# %AVAILABILITY%
128# RETURN VALUE
130If this function returns *CURLSSLSET_OK*, the backend was successfully
131selected.
133If the chosen backend is unknown (or support for the chosen backend has not
134been compiled into libcurl), the function returns
135*CURLSSLSET_UNKNOWN_BACKEND*.
137If the backend had been configured previously, or if curl_global_init(3)
138has already been called, the function returns *CURLSSLSET_TOO_LATE*.
140If this libcurl was built completely without SSL support, with no backends at
141all, this function returns *CURLSSLSET_NO_BACKENDS*.
Diagnostics4 git calls · 24 ms
CallStatusSizeTime024 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2001.9 KiB · hit19 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=19
git.response.bytes=1939
git.response.cache=HIT
git.response.duration_ms=19
git.fetch.wants=fa80a8cc411b72bc29f932aa0f1099391c7035e1
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1939
git.pkt.payload.max=1918
git.sideband.band1.bytes=1917
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e33a0e3b45f162
Request
5460eb49…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format