Lines Matching defs:c_id
130 #define CONN_HOSTNAME c_id->uri.hport.hostname
131 #define CONN_PORT c_id->uri.hport.port
132 #define CONN_ABSPATH c_id->uri.abspath
133 #define CONN_HTTPS c_id->uri.https
134 #define CONN_PROXY_HOSTNAME c_id->proxy.hostname
135 #define CONN_PROXY_PORT c_id->proxy.port
137 #define RESET_ERR(c_id) (c_id)->numerrs = 0, (c_id)->nexterr = 0
138 #define SET_ERR(c_id, src, err) if ((c_id)->numerrs < ESTACK_SIZE) \
139 (c_id)->errs[(c_id)->numerrs].errsrc = (src), \
140 (c_id)->errs[(c_id)->numerrs ++].error = (err)
142 #define GET_ERR(c_id, e_src, e_code) \
143 if ((c_id)->nexterr < (c_id)->numerrs) \
144 (e_src) = (c_id)->errs[((c_id)->nexterr)].errsrc, \
145 (e_code) = (c_id)->errs[((c_id)->nexterr)++].error; \
155 c_id->body_read++;\
156 c_id->body_read_tot++; \
295 http_conn_t *c_id;
303 if ((c_id = malloc(sizeof (*c_id))) == NULL) {
308 bzero(c_id, sizeof (*c_id));
309 c_id->uri = *url;
310 c_id->proxied = B_FALSE;
311 c_id->read_timeout = DEFAULT_TIMEOUT;
312 c_id->keepalive = B_TRUE;
313 c_id->fd = -1;
316 c_id->signature = HTTP_CONN_INFO;
318 return (c_id);
340 http_conn_t *c_id = handle;
342 if (!http_check_conn(c_id))
366 http_conn_t *c_id = handle;
368 if (!http_check_conn(c_id))
372 c_id->proxy = *proxy;
373 c_id->proxied = B_TRUE;
376 c_id->proxied = B_FALSE;
401 http_conn_t *c_id = handle;
403 if (!http_check_conn(c_id))
406 c_id->keepalive = on_off;
430 http_conn_t *c_id = handle;
432 if (!http_check_conn(c_id))
435 c_id->read_timeout = (timout) ? timout : DEFAULT_TIMEOUT;
459 http_conn_t *c_id = handle;
461 if (!http_check_conn(c_id))
465 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
474 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
478 free(c_id->basic_auth_userid);
479 c_id->basic_auth_userid = (char *)userid;
480 free(c_id->basic_auth_password);
481 c_id->basic_auth_password = (char *)password;
504 http_conn_t *c_id = handle;
506 if (!http_check_conn(c_id))
512 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
517 free(c_id->random_file);
518 c_id->random_file = (char *)fname;
574 http_conn_t *c_id = handle;
576 if (!http_check_conn(c_id))
582 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
587 free(c_id->client_cert_file);
588 c_id->client_cert_file = (char *)fname;
610 http_conn_t *c_id = handle;
612 if (!http_check_conn(c_id))
618 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
623 free(c_id->file_password);
624 c_id->file_password = (char *)password;
669 http_conn_t *c_id = handle;
671 if (!http_check_conn(c_id))
677 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
682 free(c_id->private_key_file);
683 c_id->private_key_file = (char *)fname;
702 http_conn_t *c_id = handle;
707 if (!http_check_conn(c_id))
712 ctx = initialize_ctx(c_id);
721 if (c_id->proxied) {
722 c_id->fd = proxy_connect(c_id);
724 c_id->fd = tcp_connect(c_id, CONN_HOSTNAME, CONN_PORT);
727 if (c_id->fd < 0) {
732 (c_id->proxied) ? "proxy_connect" : "tcp_connect",
733 c_id->fd);
739 if ((c_id->ssl = SSL_new(ctx)) == NULL) {
742 SET_ERR(c_id, ERRSRC_LIBSSL, err);
746 (void) free_ctx_ssl(c_id);
750 print_ciphers(c_id->ssl);
753 SSL_set_connect_state(c_id->ssl);
755 if (SSL_set_fd(c_id->ssl, c_id->fd) == 0) {
758 SET_ERR(c_id, ERRSRC_LIBSSL, err);
761 (void) free_ctx_ssl(c_id);
765 if ((retval = SSL_connect(c_id->ssl)) <= 0) {
766 handle_ssl_error(c_id, retval);
769 (void) free_ctx_ssl(c_id);
773 if (check_cert_chain(c_id, CONN_HOSTNAME) != 0) {
774 (void) free_ctx_ssl(c_id);
779 print_ciphers(c_id->ssl);
846 http_conn_t *c_id = handle;
848 if (!http_check_conn(c_id))
852 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
923 http_conn_t *c_id = handle;
930 if (!http_check_conn(c_id))
935 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
946 i = getaline(c_id, line, sizeof (line), B_FALSE);
960 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NODATA);
964 free_response(c_id, B_TRUE);
972 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOT_1_1);
987 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADHDR);
990 c_id->resp.code = strtol(ptr, NULL, 10);
998 c_id->resp.statusmsg = malloc(strlen(ptr) + 1);
999 if (c_id->resp.statusmsg == NULL) {
1001 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1004 (void) strcpy(c_id->resp.statusmsg, ptr);
1006 if ((i = read_headerlines(c_id, B_FALSE)) < 0) {
1036 c_id->boundary = strdup(ptr2);
1037 if (c_id->boundary == NULL) {
1040 SET_ERR(c_id, ERRSRC_LIBHTTP,
1044 c_id->boundary_len = strlen(c_id->boundary);
1045 c_id->is_multipart = B_TRUE;
1046 c_id->is_firstpart = B_TRUE;
1055 if (init_bread(c_id) != 0) {
1065 lresp->code = c_id->resp.code;
1066 lresp->nresphdrs = c_id->resp.nresphdrs;
1067 lresp->statusmsg = strdup(c_id->resp.statusmsg);
1070 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1118 http_conn_t *c_id = handle;
1125 if (!http_check_conn(c_id))
1128 if (c_id->is_multipart == 0) {
1129 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOTMULTI);
1143 if (c_id->is_firstpart) {
1145 c_id->is_firstpart = B_FALSE;
1151 while ((i = getaline(c_id, line, sizeof (line), B_TRUE)) == 0 &&
1159 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOBOUNDARY);
1163 free_response(c_id, B_FALSE);
1171 strncmp(&line[2], c_id->boundary, c_id->boundary_len) != 0) {
1173 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOBOUNDARY);
1178 if (strcmp(&line[c_id->boundary_len + 2], "--") == 0) {
1182 free_response(c_id, B_FALSE);
1183 if (read_headerlines(c_id, B_TRUE) < 0) {
1191 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1196 (*resp)->nresphdrs = c_id->resp.nresphdrs;
1220 http_conn_t *c_id = handle;
1223 if (!http_check_conn(c_id))
1226 if (which >= c_id->resp.nresphdrs) {
1227 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_OORANGE);
1231 res = strdup(c_id->resphdr[which]);
1233 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1255 http_conn_t *c_id = handle;
1261 if (!http_check_conn(c_id))
1265 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1269 for (i = 0; i < c_id->resp.nresphdrs; i++) {
1270 ptr = c_id->resphdr[i];
1280 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1286 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMATCH);
1315 http_conn_t *c_id = handle;
1318 if (!http_check_conn(c_id))
1322 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1326 return (getbytes(c_id, recv_buf_ptr, recv_buf_size));
1346 http_conn_t *c_id = handle;
1350 if (!http_check_conn(c_id))
1353 err_ret = free_ctx_ssl(c_id);
1354 bzero(&c_id->inbuf, sizeof (c_id->inbuf));
1355 free_response(c_id, B_TRUE);
1377 http_conn_t *c_id = handle;
1380 if (!http_check_conn(c_id))
1383 if (c_id->ctx != NULL || c_id->ssl != NULL || c_id->fd != -1)
1386 free(c_id->basic_auth_userid);
1387 free(c_id->basic_auth_password);
1388 free(c_id->resp.statusmsg);
1389 free(c_id->client_cert_file);
1390 free(c_id->private_key_file);
1391 free(c_id->random_file);
1392 free(c_id->file_password);
1393 c_id->signature = 0;
1395 free(c_id);
1414 http_conn_t *c_id = handle;
1417 if (!http_check_conn(c_id))
1422 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1428 info->uri = c_id->uri;
1429 info->proxy = c_id->proxy;
1430 info->keepalive = c_id->keepalive;
1431 info->read_timeout = c_id->read_timeout;
1454 http_conn_t *c_id = handle;
1458 if (c_id == NULL || c_id->signature != HTTP_CONN_INFO) {
1466 GET_ERR(c_id, src, err);
1531 http_conn_t *c_id = handle;
1540 if (!http_check_conn(c_id))
1544 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1553 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1563 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1569 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1597 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1602 if (c_id->proxied && c_id->ssl == NULL) {
1615 if (!c_id->keepalive)
1638 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1654 if (c_id->basic_auth_userid && c_id->basic_auth_password) {
1662 authlen = strlen(c_id->basic_auth_userid) + 2 +
1663 strlen(c_id->basic_auth_password);
1666 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1670 c_id->basic_auth_userid, c_id->basic_auth_password);
1676 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1691 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1709 retval = http_srv_send(c_id, request, j);
1743 http_conn_t *c_id = userdata;
1745 if (c_id == NULL || c_id->signature != HTTP_CONN_INFO)
1748 if (c_id->file_password == NULL ||
1749 buflen < strlen(c_id->file_password) + 1)
1752 return (strlcpy(buf, c_id->file_password, buflen));
1758 * ctx = initialize_ctx(c_id);
1769 initialize_ctx(http_conn_t *c_id)
1792 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1806 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1818 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1834 if (c_id->client_cert_file != NULL) {
1837 if (sunw_p12_use_certfile(ctx, c_id->client_cert_file,
1838 c_id->file_password)
1842 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1852 c_id->client_cert_file, SSL_FILETYPE_PEM) <= 0) {
1855 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1863 if (c_id->private_key_file == NULL)
1864 c_id->private_key_file = c_id->client_cert_file;
1870 if (c_id->private_key_file != NULL) {
1871 if (sunw_p12_use_keyfile(ctx, c_id->private_key_file,
1872 c_id->file_password)
1876 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1887 SSL_CTX_set_default_passwd_cb_userdata(ctx, c_id);
1888 if (c_id->private_key_file != NULL) {
1890 c_id->private_key_file, SSL_FILETYPE_PEM) <= 0) {
1893 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1907 c_id->file_password)
1911 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1923 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1936 if (c_id->random_file != NULL &&
1937 RAND_load_file(c_id->random_file, 1024 * 1024) <= 0) {
1940 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1949 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1962 * sock = tcp_connect(c_id, hostname, port);
1965 * c_id - Structure associated with the desired connection
1978 tcp_connect(http_conn_t *c_id, const char *hostname, uint16_t port)
1986 SET_ERR(c_id, ERRSRC_RESOLVE, h_errno);
1997 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2003 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2008 c_id->host_addr = addr; /* save for future sendto calls */
2009 c_id->fd = sock;
2018 * ret = readline(c_id, sock, buf, len);
2021 * c_id - Structure associated with the desired connection
2032 readline(http_conn_t *c_id, int sock, char *buf, int len)
2038 r = socket_read(sock, ptr, 1, c_id->read_timeout);
2041 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2070 * sock = proxy_connect(c_id);
2073 * c_id - Structure associated with the desired connection
2086 proxy_connect(http_conn_t *c_id)
2094 if ((sock = tcp_connect(c_id, CONN_PROXY_HOSTNAME,
2109 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2115 i = readline(c_id, sock, buf, sizeof (buf));
2118 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NORESP);
2127 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOT_1_1);
2143 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADRESP);
2151 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADRESP);
2157 while ((i = readline(c_id, sock, buf, sizeof (buf))) > 0)
2171 * ret = check_cert_chain(c_id, host);
2174 * c_id - Connection info.
2182 check_cert_chain(http_conn_t *c_id, char *host)
2188 if ((verify_err = SSL_get_verify_result(c_id->ssl)) != X509_V_OK) {
2189 SET_ERR(c_id, ERRSRC_VERIFERR, verify_err);
2205 if ((peer = SSL_get_peer_certificate(c_id->ssl)) == NULL) {
2206 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOCERT);
2219 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMATCH);
2271 * ret = read_headerlines(c_id);
2274 * c_id - Info about the connection being read.
2285 * c_id->resphdr.
2291 read_headerlines(http_conn_t *c_id, boolean_t bread)
2303 while ((n = getaline(c_id, line, sizeof (line), bread)) > 0) {
2316 realloc(c_id->resphdr, (cur + 1) * sizeof (void *));
2318 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
2321 c_id->resphdr = new_buf;
2323 c_id->resphdr[cur] = strdup(line);
2324 if (c_id->resphdr[cur] == NULL) {
2325 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
2332 c_id->resphdr[cur] = realloc(c_id->resphdr[cur],
2333 strlen(c_id->resphdr[cur]) + strlen(ptr) + 1);
2334 if (c_id->resphdr[cur] == NULL) {
2335 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
2338 (void) strcat(c_id->resphdr[cur], ptr);
2340 ptr = &(c_id->resphdr[cur][strlen(c_id->resphdr[cur]) - 1]);
2341 while (ptr > c_id->resphdr[cur] && isspace(*ptr))
2344 c_id->resp.nresphdrs = next;
2351 free_response(http_conn_t *c_id, int free_boundary)
2356 if (c_id->resp.statusmsg != NULL) {
2357 free(c_id->resp.statusmsg);
2358 c_id->resp.statusmsg = NULL;
2360 for (i = 0; i < c_id->resp.nresphdrs; i++) {
2361 free(c_id->resphdr[i]);
2362 c_id->resphdr[i] = NULL;
2364 c_id->resp.nresphdrs = 0;
2365 if (c_id->resphdr != NULL) {
2366 free(c_id->resphdr);
2367 c_id->resphdr = NULL;
2370 if (free_boundary && c_id->boundary) {
2371 free(c_id->boundary);
2372 c_id->boundary = NULL;
2373 c_id->is_multipart = B_FALSE;
2378 free_ctx_ssl(http_conn_t *c_id)
2382 if (c_id->ssl != NULL) {
2383 if (SSL_shutdown(c_id->ssl) <= 0) {
2386 SET_ERR(c_id, ERRSRC_LIBSSL, err);
2389 SSL_free(c_id->ssl);
2390 c_id->ssl = NULL;
2393 if (c_id->fd != -1 && socket_close(c_id->fd) < 0) {
2394 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2397 c_id->fd = -1;
2399 if (c_id->ctx != NULL) {
2400 SSL_CTX_free(c_id->ctx);
2401 c_id->ctx = NULL;
2411 * c_id - Structure describing the connection in question.
2418 get_chunk_header(http_conn_t *c_id)
2431 if (c_id->is_firstchunk) {
2433 c_id->is_firstchunk = B_FALSE;
2435 ok = ((i = getaline(c_id, line, sizeof (line), B_FALSE)) == 0);
2439 i = getaline(c_id, line, sizeof (line), B_FALSE);
2445 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOHEADER);
2471 * c_id - Structure describing the connection in question.
2482 init_bread(http_conn_t *c_id)
2491 c_id->is_chunked = B_FALSE;
2492 c_id->is_firstchunk = B_FALSE;
2493 hdr = http_get_header_value(c_id, "Content-Length");
2495 c_id->body_size = strtol(hdr, NULL, 10);
2496 if (c_id->body_size == 0 && errno != 0) {
2498 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADSIZE);
2511 hdr = http_get_header_value(c_id, "Transfer-Encoding");
2516 c_id->is_firstchunk = B_TRUE;
2517 c_id->is_chunked = B_TRUE;
2520 if (c_id->is_chunked) {
2521 c_id->body_size = get_chunk_header(c_id);
2522 if (c_id->body_size == -1) {
2539 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADSIZE);
2543 c_id->body_read = 0;
2544 c_id->body_size_tot = c_id->body_size;
2545 c_id->body_read_tot = 0;
2554 * c_id - Structure describing the connection in question.
2569 get_msgcnt(http_conn_t *c_id, ssize_t *msgcnt)
2574 *msgcnt = c_id->body_size - c_id->body_read;
2582 if (!c_id->is_chunked) {
2591 c_id->body_size = get_chunk_header(c_id);
2592 if (c_id->body_size == -1) {
2603 c_id->body_read = 0;
2609 if (c_id->body_size == 0) {
2610 c_id->is_chunked = B_FALSE;
2617 c_id->body_size_tot += c_id->body_size;
2618 *msgcnt = c_id->body_size - c_id->body_read;
2629 * c_id - Structure describing the connection in question.
2647 getaline(http_conn_t *c_id, char *line, int len, boolean_t bread)
2666 if (get_msgcnt(c_id, &msgcnt) == -1) {
2673 cnt = MIN(msgcnt, sizeof (c_id->inbuf.buf));
2675 cnt = sizeof (c_id->inbuf.buf);
2679 if (c_id->inbuf.i == c_id->inbuf.n) {
2680 c_id->inbuf.i = 0;
2681 c_id->inbuf.n = http_srv_recv(c_id, c_id->inbuf.buf,
2683 if (c_id->inbuf.n == 0) {
2686 if (c_id->inbuf.n < 0) {
2691 if (c_id->inbuf.buf[c_id->inbuf.i] == '\r') {
2693 c_id->inbuf.i++;
2696 if (c_id->inbuf.buf[c_id->inbuf.i] == '\n') {
2698 c_id->inbuf.i++;
2704 line[i++] = c_id->inbuf.buf[c_id->inbuf.i++];
2713 * c_id - Structure describing the connection in question.
2734 getbytes(http_conn_t *c_id, char *line, int len)
2750 if (get_msgcnt(c_id, &msgcnt) == -1) {
2760 if (c_id->inbuf.n != c_id->inbuf.i) {
2761 nbytes = (int)MIN(cnt, c_id->inbuf.n - c_id->inbuf.i);
2762 (void) memcpy(line, &c_id->inbuf.buf[c_id->inbuf.i],
2764 c_id->inbuf.i += nbytes;
2766 nbytes = http_srv_recv(c_id, line, cnt);
2778 c_id->body_read += nbytes;
2779 c_id->body_read_tot += nbytes;
2786 http_srv_send(http_conn_t *c_id, const void *buf, size_t nbyte)
2790 if (c_id->ssl != NULL) {
2791 if ((retval = SSL_write(c_id->ssl, buf, nbyte)) <= 0) {
2792 handle_ssl_error(c_id, retval);
2796 retval = socket_write(c_id->fd, buf, nbyte, &c_id->host_addr);
2798 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2806 http_srv_recv(http_conn_t *c_id, void *buf, size_t nbyte)
2810 if (c_id->ssl != NULL) {
2811 if ((retval = SSL_read(c_id->ssl, buf, nbyte)) <= 0) {
2812 handle_ssl_error(c_id, retval);
2816 retval = socket_read(c_id->fd, buf, nbyte, c_id->read_timeout);
2818 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2826 http_check_conn(http_conn_t *c_id)
2829 if (c_id == NULL || c_id->signature != HTTP_CONN_INFO) {
2833 RESET_ERR(c_id);
2838 handle_ssl_error(http_conn_t *c_id, int retval)
2842 err = SSL_get_error(c_id->ssl, retval);
2849 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_CONCLOSED);
2856 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_UNEXPECTED);
2862 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_EOFERR);
2864 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2866 SET_ERR(c_id, ERRSRC_LIBSSL, err);
2868 SET_ERR(c_id, ERRSRC_LIBSSL, err);
2874 SET_ERR(c_id, ERRSRC_LIBSSL, err);