Lines Matching refs:c_id

129 #define	CONN_HOSTNAME		c_id->uri.hport.hostname
130 #define CONN_PORT c_id->uri.hport.port
131 #define CONN_ABSPATH c_id->uri.abspath
132 #define CONN_HTTPS c_id->uri.https
133 #define CONN_PROXY_HOSTNAME c_id->proxy.hostname
134 #define CONN_PROXY_PORT c_id->proxy.port
136 #define RESET_ERR(c_id) (c_id)->numerrs = 0, (c_id)->nexterr = 0
137 #define SET_ERR(c_id, src, err) if ((c_id)->numerrs < ESTACK_SIZE) \
138 (c_id)->errs[(c_id)->numerrs].errsrc = (src), \
139 (c_id)->errs[(c_id)->numerrs ++].error = (err)
141 #define GET_ERR(c_id, e_src, e_code) \
142 if ((c_id)->nexterr < (c_id)->numerrs) \
143 (e_src) = (c_id)->errs[((c_id)->nexterr)].errsrc, \
144 (e_code) = (c_id)->errs[((c_id)->nexterr)++].error; \
154 c_id->body_read++;\
155 c_id->body_read_tot++; \
294 http_conn_t *c_id;
302 if ((c_id = malloc(sizeof (*c_id))) == NULL) {
307 bzero(c_id, sizeof (*c_id));
308 c_id->uri = *url;
309 c_id->proxied = B_FALSE;
310 c_id->read_timeout = DEFAULT_TIMEOUT;
311 c_id->keepalive = B_TRUE;
312 c_id->fd = -1;
315 c_id->signature = HTTP_CONN_INFO;
317 return (c_id);
339 http_conn_t *c_id = handle;
341 if (!http_check_conn(c_id))
365 http_conn_t *c_id = handle;
367 if (!http_check_conn(c_id))
371 c_id->proxy = *proxy;
372 c_id->proxied = B_TRUE;
375 c_id->proxied = B_FALSE;
400 http_conn_t *c_id = handle;
402 if (!http_check_conn(c_id))
405 c_id->keepalive = on_off;
429 http_conn_t *c_id = handle;
431 if (!http_check_conn(c_id))
434 c_id->read_timeout = (timout) ? timout : DEFAULT_TIMEOUT;
458 http_conn_t *c_id = handle;
460 if (!http_check_conn(c_id))
464 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
473 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
477 free(c_id->basic_auth_userid);
478 c_id->basic_auth_userid = (char *)userid;
479 free(c_id->basic_auth_password);
480 c_id->basic_auth_password = (char *)password;
503 http_conn_t *c_id = handle;
505 if (!http_check_conn(c_id))
511 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
516 free(c_id->random_file);
517 c_id->random_file = (char *)fname;
573 http_conn_t *c_id = handle;
575 if (!http_check_conn(c_id))
581 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
586 free(c_id->client_cert_file);
587 c_id->client_cert_file = (char *)fname;
609 http_conn_t *c_id = handle;
611 if (!http_check_conn(c_id))
617 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
622 free(c_id->file_password);
623 c_id->file_password = (char *)password;
668 http_conn_t *c_id = handle;
670 if (!http_check_conn(c_id))
676 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
681 free(c_id->private_key_file);
682 c_id->private_key_file = (char *)fname;
701 http_conn_t *c_id = handle;
706 if (!http_check_conn(c_id))
711 ctx = initialize_ctx(c_id);
720 if (c_id->proxied) {
721 c_id->fd = proxy_connect(c_id);
723 c_id->fd = tcp_connect(c_id, CONN_HOSTNAME, CONN_PORT);
726 if (c_id->fd < 0) {
731 (c_id->proxied) ? "proxy_connect" : "tcp_connect",
732 c_id->fd);
738 if ((c_id->ssl = SSL_new(ctx)) == NULL) {
741 SET_ERR(c_id, ERRSRC_LIBSSL, err);
745 (void) free_ctx_ssl(c_id);
749 print_ciphers(c_id->ssl);
752 SSL_set_connect_state(c_id->ssl);
754 if (SSL_set_fd(c_id->ssl, c_id->fd) == 0) {
757 SET_ERR(c_id, ERRSRC_LIBSSL, err);
760 (void) free_ctx_ssl(c_id);
764 if ((retval = SSL_connect(c_id->ssl)) <= 0) {
765 handle_ssl_error(c_id, retval);
768 (void) free_ctx_ssl(c_id);
772 if (check_cert_chain(c_id, CONN_HOSTNAME) != 0) {
773 (void) free_ctx_ssl(c_id);
778 print_ciphers(c_id->ssl);
845 http_conn_t *c_id = handle;
847 if (!http_check_conn(c_id))
851 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
922 http_conn_t *c_id = handle;
929 if (!http_check_conn(c_id))
934 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
945 i = getaline(c_id, line, sizeof (line), B_FALSE);
959 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NODATA);
963 free_response(c_id, B_TRUE);
971 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOT_1_1);
986 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADHDR);
989 c_id->resp.code = strtol(ptr, NULL, 10);
997 c_id->resp.statusmsg = malloc(strlen(ptr) + 1);
998 if (c_id->resp.statusmsg == NULL) {
1000 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1003 (void) strcpy(c_id->resp.statusmsg, ptr);
1005 if ((i = read_headerlines(c_id, B_FALSE)) < 0) {
1035 c_id->boundary = strdup(ptr2);
1036 if (c_id->boundary == NULL) {
1039 SET_ERR(c_id, ERRSRC_LIBHTTP,
1043 c_id->boundary_len = strlen(c_id->boundary);
1044 c_id->is_multipart = B_TRUE;
1045 c_id->is_firstpart = B_TRUE;
1054 if (init_bread(c_id) != 0) {
1064 lresp->code = c_id->resp.code;
1065 lresp->nresphdrs = c_id->resp.nresphdrs;
1066 lresp->statusmsg = strdup(c_id->resp.statusmsg);
1069 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1117 http_conn_t *c_id = handle;
1124 if (!http_check_conn(c_id))
1127 if (c_id->is_multipart == 0) {
1128 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOTMULTI);
1142 if (c_id->is_firstpart) {
1144 c_id->is_firstpart = B_FALSE;
1150 while ((i = getaline(c_id, line, sizeof (line), B_TRUE)) == 0 &&
1158 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOBOUNDARY);
1162 free_response(c_id, B_FALSE);
1170 strncmp(&line[2], c_id->boundary, c_id->boundary_len) != 0) {
1172 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOBOUNDARY);
1177 if (strcmp(&line[c_id->boundary_len + 2], "--") == 0) {
1181 free_response(c_id, B_FALSE);
1182 if (read_headerlines(c_id, B_TRUE) < 0) {
1190 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1195 (*resp)->nresphdrs = c_id->resp.nresphdrs;
1219 http_conn_t *c_id = handle;
1222 if (!http_check_conn(c_id))
1225 if (which >= c_id->resp.nresphdrs) {
1226 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_OORANGE);
1230 res = strdup(c_id->resphdr[which]);
1232 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1254 http_conn_t *c_id = handle;
1260 if (!http_check_conn(c_id))
1264 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1268 for (i = 0; i < c_id->resp.nresphdrs; i++) {
1269 ptr = c_id->resphdr[i];
1279 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1285 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMATCH);
1314 http_conn_t *c_id = handle;
1317 if (!http_check_conn(c_id))
1321 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1325 return (getbytes(c_id, recv_buf_ptr, recv_buf_size));
1345 http_conn_t *c_id = handle;
1349 if (!http_check_conn(c_id))
1352 err_ret = free_ctx_ssl(c_id);
1353 bzero(&c_id->inbuf, sizeof (c_id->inbuf));
1354 free_response(c_id, B_TRUE);
1376 http_conn_t *c_id = handle;
1379 if (!http_check_conn(c_id))
1382 if (c_id->ctx != NULL || c_id->ssl != NULL || c_id->fd != -1)
1385 free(c_id->basic_auth_userid);
1386 free(c_id->basic_auth_password);
1387 free(c_id->resp.statusmsg);
1388 free(c_id->client_cert_file);
1389 free(c_id->private_key_file);
1390 free(c_id->random_file);
1391 free(c_id->file_password);
1392 c_id->signature = 0;
1394 free(c_id);
1413 http_conn_t *c_id = handle;
1416 if (!http_check_conn(c_id))
1421 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1427 info->uri = c_id->uri;
1428 info->proxy = c_id->proxy;
1429 info->keepalive = c_id->keepalive;
1430 info->read_timeout = c_id->read_timeout;
1453 http_conn_t *c_id = handle;
1457 if (c_id == NULL || c_id->signature != HTTP_CONN_INFO) {
1465 GET_ERR(c_id, src, err);
1530 http_conn_t *c_id = handle;
1539 if (!http_check_conn(c_id))
1543 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1552 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1562 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1568 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADARG);
1596 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1601 if (c_id->proxied && c_id->ssl == NULL) {
1614 if (!c_id->keepalive)
1637 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1653 if (c_id->basic_auth_userid && c_id->basic_auth_password) {
1661 authlen = strlen(c_id->basic_auth_userid) + 2 +
1662 strlen(c_id->basic_auth_password);
1665 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1669 c_id->basic_auth_userid, c_id->basic_auth_password);
1675 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1690 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
1708 retval = http_srv_send(c_id, request, j);
1742 http_conn_t *c_id = userdata;
1744 if (c_id == NULL || c_id->signature != HTTP_CONN_INFO)
1747 if (c_id->file_password == NULL ||
1748 buflen < strlen(c_id->file_password) + 1)
1751 return (strlcpy(buf, c_id->file_password, buflen));
1757 * ctx = initialize_ctx(c_id);
1768 initialize_ctx(http_conn_t *c_id)
1787 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1801 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1813 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1829 if (c_id->client_cert_file != NULL) {
1832 if (sunw_p12_use_certfile(ctx, c_id->client_cert_file,
1833 c_id->file_password)
1837 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1847 c_id->client_cert_file, SSL_FILETYPE_PEM) <= 0) {
1850 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1858 if (c_id->private_key_file == NULL)
1859 c_id->private_key_file = c_id->client_cert_file;
1865 if (c_id->private_key_file != NULL) {
1866 if (sunw_p12_use_keyfile(ctx, c_id->private_key_file,
1867 c_id->file_password)
1871 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1882 SSL_CTX_set_default_passwd_cb_userdata(ctx, c_id);
1883 if (c_id->private_key_file != NULL) {
1885 c_id->private_key_file, SSL_FILETYPE_PEM) <= 0) {
1888 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1902 c_id->file_password)
1906 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1918 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1931 if (c_id->random_file != NULL &&
1932 RAND_load_file(c_id->random_file, 1024 * 1024) <= 0) {
1935 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1944 SET_ERR(c_id, ERRSRC_LIBSSL, err);
1957 * sock = tcp_connect(c_id, hostname, port);
1960 * c_id - Structure associated with the desired connection
1973 tcp_connect(http_conn_t *c_id, const char *hostname, uint16_t port)
1981 SET_ERR(c_id, ERRSRC_RESOLVE, h_errno);
1992 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
1998 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2003 c_id->host_addr = addr; /* save for future sendto calls */
2004 c_id->fd = sock;
2013 * ret = readline(c_id, sock, buf, len);
2016 * c_id - Structure associated with the desired connection
2027 readline(http_conn_t *c_id, int sock, char *buf, int len)
2033 r = socket_read(sock, ptr, 1, c_id->read_timeout);
2036 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2065 * sock = proxy_connect(c_id);
2068 * c_id - Structure associated with the desired connection
2081 proxy_connect(http_conn_t *c_id)
2089 if ((sock = tcp_connect(c_id, CONN_PROXY_HOSTNAME,
2104 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2110 i = readline(c_id, sock, buf, sizeof (buf));
2113 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NORESP);
2122 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOT_1_1);
2138 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADRESP);
2146 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADRESP);
2152 while ((i = readline(c_id, sock, buf, sizeof (buf))) > 0)
2166 * ret = check_cert_chain(c_id, host);
2169 * c_id - Connection info.
2177 check_cert_chain(http_conn_t *c_id, char *host)
2183 if ((verify_err = SSL_get_verify_result(c_id->ssl)) != X509_V_OK) {
2184 SET_ERR(c_id, ERRSRC_VERIFERR, verify_err);
2200 if ((peer = SSL_get_peer_certificate(c_id->ssl)) == NULL) {
2201 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOCERT);
2214 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMATCH);
2266 * ret = read_headerlines(c_id);
2269 * c_id - Info about the connection being read.
2280 * c_id->resphdr.
2286 read_headerlines(http_conn_t *c_id, boolean_t bread)
2298 while ((n = getaline(c_id, line, sizeof (line), bread)) > 0) {
2311 realloc(c_id->resphdr, (cur + 1) * sizeof (void *));
2313 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
2316 c_id->resphdr = new_buf;
2318 c_id->resphdr[cur] = strdup(line);
2319 if (c_id->resphdr[cur] == NULL) {
2320 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
2327 c_id->resphdr[cur] = realloc(c_id->resphdr[cur],
2328 strlen(c_id->resphdr[cur]) + strlen(ptr) + 1);
2329 if (c_id->resphdr[cur] == NULL) {
2330 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOMEM);
2333 (void) strcat(c_id->resphdr[cur], ptr);
2335 ptr = &(c_id->resphdr[cur][strlen(c_id->resphdr[cur]) - 1]);
2336 while (ptr > c_id->resphdr[cur] && isspace(*ptr))
2339 c_id->resp.nresphdrs = next;
2346 free_response(http_conn_t *c_id, int free_boundary)
2351 if (c_id->resp.statusmsg != NULL) {
2352 free(c_id->resp.statusmsg);
2353 c_id->resp.statusmsg = NULL;
2355 for (i = 0; i < c_id->resp.nresphdrs; i++) {
2356 free(c_id->resphdr[i]);
2357 c_id->resphdr[i] = NULL;
2359 c_id->resp.nresphdrs = 0;
2360 if (c_id->resphdr != NULL) {
2361 free(c_id->resphdr);
2362 c_id->resphdr = NULL;
2365 if (free_boundary && c_id->boundary) {
2366 free(c_id->boundary);
2367 c_id->boundary = NULL;
2368 c_id->is_multipart = B_FALSE;
2373 free_ctx_ssl(http_conn_t *c_id)
2377 if (c_id->ssl != NULL) {
2378 if (SSL_shutdown(c_id->ssl) <= 0) {
2381 SET_ERR(c_id, ERRSRC_LIBSSL, err);
2384 SSL_free(c_id->ssl);
2385 c_id->ssl = NULL;
2388 if (c_id->fd != -1 && socket_close(c_id->fd) < 0) {
2389 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2392 c_id->fd = -1;
2394 if (c_id->ctx != NULL) {
2395 SSL_CTX_free(c_id->ctx);
2396 c_id->ctx = NULL;
2406 * c_id - Structure describing the connection in question.
2413 get_chunk_header(http_conn_t *c_id)
2426 if (c_id->is_firstchunk) {
2428 c_id->is_firstchunk = B_FALSE;
2430 ok = ((i = getaline(c_id, line, sizeof (line), B_FALSE)) == 0);
2434 i = getaline(c_id, line, sizeof (line), B_FALSE);
2440 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_NOHEADER);
2466 * c_id - Structure describing the connection in question.
2477 init_bread(http_conn_t *c_id)
2486 c_id->is_chunked = B_FALSE;
2487 c_id->is_firstchunk = B_FALSE;
2488 hdr = http_get_header_value(c_id, "Content-Length");
2490 c_id->body_size = strtol(hdr, NULL, 10);
2491 if (c_id->body_size == 0 && errno != 0) {
2493 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADSIZE);
2506 hdr = http_get_header_value(c_id, "Transfer-Encoding");
2511 c_id->is_firstchunk = B_TRUE;
2512 c_id->is_chunked = B_TRUE;
2515 if (c_id->is_chunked) {
2516 c_id->body_size = get_chunk_header(c_id);
2517 if (c_id->body_size == -1) {
2534 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_BADSIZE);
2538 c_id->body_read = 0;
2539 c_id->body_size_tot = c_id->body_size;
2540 c_id->body_read_tot = 0;
2549 * c_id - Structure describing the connection in question.
2564 get_msgcnt(http_conn_t *c_id, ssize_t *msgcnt)
2569 *msgcnt = c_id->body_size - c_id->body_read;
2577 if (!c_id->is_chunked) {
2586 c_id->body_size = get_chunk_header(c_id);
2587 if (c_id->body_size == -1) {
2598 c_id->body_read = 0;
2604 if (c_id->body_size == 0) {
2605 c_id->is_chunked = B_FALSE;
2612 c_id->body_size_tot += c_id->body_size;
2613 *msgcnt = c_id->body_size - c_id->body_read;
2624 * c_id - Structure describing the connection in question.
2642 getaline(http_conn_t *c_id, char *line, int len, boolean_t bread)
2661 if (get_msgcnt(c_id, &msgcnt) == -1) {
2668 cnt = MIN(msgcnt, sizeof (c_id->inbuf.buf));
2670 cnt = sizeof (c_id->inbuf.buf);
2674 if (c_id->inbuf.i == c_id->inbuf.n) {
2675 c_id->inbuf.i = 0;
2676 c_id->inbuf.n = http_srv_recv(c_id, c_id->inbuf.buf,
2678 if (c_id->inbuf.n == 0) {
2681 if (c_id->inbuf.n < 0) {
2686 if (c_id->inbuf.buf[c_id->inbuf.i] == '\r') {
2688 c_id->inbuf.i++;
2691 if (c_id->inbuf.buf[c_id->inbuf.i] == '\n') {
2693 c_id->inbuf.i++;
2699 line[i++] = c_id->inbuf.buf[c_id->inbuf.i++];
2708 * c_id - Structure describing the connection in question.
2729 getbytes(http_conn_t *c_id, char *line, int len)
2745 if (get_msgcnt(c_id, &msgcnt) == -1) {
2755 if (c_id->inbuf.n != c_id->inbuf.i) {
2756 nbytes = (int)MIN(cnt, c_id->inbuf.n - c_id->inbuf.i);
2757 (void) memcpy(line, &c_id->inbuf.buf[c_id->inbuf.i],
2759 c_id->inbuf.i += nbytes;
2761 nbytes = http_srv_recv(c_id, line, cnt);
2773 c_id->body_read += nbytes;
2774 c_id->body_read_tot += nbytes;
2781 http_srv_send(http_conn_t *c_id, const void *buf, size_t nbyte)
2785 if (c_id->ssl != NULL) {
2786 if ((retval = SSL_write(c_id->ssl, buf, nbyte)) <= 0) {
2787 handle_ssl_error(c_id, retval);
2791 retval = socket_write(c_id->fd, buf, nbyte, &c_id->host_addr);
2793 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2801 http_srv_recv(http_conn_t *c_id, void *buf, size_t nbyte)
2805 if (c_id->ssl != NULL) {
2806 if ((retval = SSL_read(c_id->ssl, buf, nbyte)) <= 0) {
2807 handle_ssl_error(c_id, retval);
2811 retval = socket_read(c_id->fd, buf, nbyte, c_id->read_timeout);
2813 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2821 http_check_conn(http_conn_t *c_id)
2824 if (c_id == NULL || c_id->signature != HTTP_CONN_INFO) {
2828 RESET_ERR(c_id);
2833 handle_ssl_error(http_conn_t *c_id, int retval)
2837 err = SSL_get_error(c_id->ssl, retval);
2844 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_CONCLOSED);
2851 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_UNEXPECTED);
2857 SET_ERR(c_id, ERRSRC_LIBHTTP, EHTTP_EOFERR);
2859 SET_ERR(c_id, ERRSRC_SYSTEM, errno);
2861 SET_ERR(c_id, ERRSRC_LIBSSL, err);
2863 SET_ERR(c_id, ERRSRC_LIBSSL, err);
2869 SET_ERR(c_id, ERRSRC_LIBSSL, err);