Lines Matching refs:http
11 * file is missing or damaged, see the license at "http://www.cups.org/".
23 #include "http.h"
50 "http",
123 * '_httpBIOMethods()' - Get the OpenSSL BIO methods for HTTP connections.
134 * 'http_bio_ctrl()' - Control the HTTP connection.
233 http_t *http; /* HTTP connection */
236 http = (http_t *)h->ptr;
238 if (!http->blocking)
244 while (!_httpWait(http, http->wait_value, 0))
246 if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
249 http->error = ETIMEDOUT;
255 return (recv(http->fd, buf, size, 0));
288 _httpTLSPending(http_t *http) /* I - HTTP connection */
290 return (SSL_pending(http->tls));
299 _httpTLSRead(http_t *http, /* I - Connection to server */
303 return (SSL_read((SSL *)(http->tls), buf, len));
323 _httpTLSStart(http_t *http) /* I - Connection to server */
332 DEBUG_printf(("3_httpTLSStart(http=%p)", (void *)http));
341 if (http->mode == _HTTP_MODE_SERVER && !tls_keypath)
344 http->error = errno = EINVAL;
345 http->status = HTTP_STATUS_ERROR;
356 BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)http);
358 http->tls = SSL_new(context);
359 SSL_set_bio(http->tls, bio, bio);
361 /* http->tls retains an internal reference to the SSL_CTX. */
364 if (http->mode == _HTTP_MODE_CLIENT)
366 SSL_set_connect_state(http->tls);
372 if (httpAddrLocalhost(http->hostaddr))
382 strlcpy(hostname, http->hostname, sizeof(hostname));
387 SSL_set_tlsext_host_name(http->tls, hostname);
396 if (SSL_do_handshake(http->tls) != 1)
407 SSL_free(http->tls);
408 http->tls = NULL;
410 http->error = errno;
411 http->status = HTTP_STATUS_ERROR;
425 X509 *peer_certificate = SSL_get_peer_certificate(http->tls);
434 error = cg->server_cert_cb(http, http->tls, credentials, cg->server_cert_data);
442 http->error = errno = EINVAL;
443 http->status = HTTP_STATUS_ERROR;
459 _httpTLSStop(http_t *http) /* I - Connection to server */
463 switch (SSL_shutdown(http->tls))
481 SSL_free(http->tls);
482 http->tls = NULL;
490 _httpTLSWrite(http_t *http, /* I - Connection to server */
497 DEBUG_printf(("2http_write_ssl(http=%p, buf=%p, len=%d)", http, buf, len));
499 result = SSL_write((SSL *)(http->tls), buf, len);