Lines Matching refs:httpd
117 bozo_clear_ssl_queue(bozohttpd_t *httpd) in bozo_clear_ssl_queue() argument
124 if (httpd->nolog) in bozo_clear_ssl_queue()
127 if (httpd->logstderr || isatty(STDERR_FILENO)) { in bozo_clear_ssl_queue()
146 bozo_ssl_warn(bozohttpd_t *httpd, const char *fmt, ...) in bozo_ssl_warn() argument
151 if (!httpd->nolog) { in bozo_ssl_warn()
152 if (httpd->logstderr || isatty(STDERR_FILENO)) { in bozo_ssl_warn()
160 bozo_clear_ssl_queue(httpd); in bozo_ssl_warn()
168 bozo_ssl_err(bozohttpd_t *httpd, int code, const char *fmt, ...) in bozo_ssl_err() argument
173 if (!httpd->nolog) { in bozo_ssl_err()
174 if (httpd->logstderr || isatty(STDERR_FILENO)) { in bozo_ssl_err()
182 bozo_clear_ssl_queue(httpd); in bozo_ssl_err()
190 bozo_check_error_queue(bozohttpd_t *httpd, const char *tag, int ret) in bozo_check_error_queue() argument
195 const sslinfo_t *sslinfo = httpd->sslinfo; in bozo_check_error_queue()
201 bozo_ssl_warn(httpd, "%s: SSL_ERROR %d", tag, sslerr); in bozo_check_error_queue()
205 bozo_ssl_printf(bozohttpd_t *httpd, const char * fmt, va_list ap) in bozo_ssl_printf() argument
211 const sslinfo_t *sslinfo = httpd->sslinfo; in bozo_ssl_printf()
213 bozo_check_error_queue(httpd, "write", ret); in bozo_ssl_printf()
222 bozo_ssl_read(bozohttpd_t *httpd, int fd, void *buf, size_t nbytes) in bozo_ssl_read() argument
224 const sslinfo_t *sslinfo = httpd->sslinfo; in bozo_ssl_read()
229 bozo_check_error_queue(httpd, "read", ret); in bozo_ssl_read()
235 bozo_ssl_write(bozohttpd_t *httpd, int fd, const void *buf, size_t nbytes) in bozo_ssl_write() argument
237 const sslinfo_t *sslinfo = httpd->sslinfo; in bozo_ssl_write()
242 bozo_check_error_queue(httpd, "write", ret); in bozo_ssl_write()
248 bozo_ssl_init(bozohttpd_t *httpd) in bozo_ssl_init() argument
250 sslinfo_t *sslinfo = httpd->sslinfo; in bozo_ssl_init()
262 bozo_ssl_err(httpd, EXIT_FAILURE, in bozo_ssl_init()
265 proto = bozo_ssl_proto(httpd->ssl_min_proto); in bozo_ssl_init()
268 bozo_ssl_err(httpd, EXIT_FAILURE, in bozo_ssl_init()
274 bozo_ssl_err(httpd, EXIT_FAILURE, in bozo_ssl_init()
279 bozo_ssl_err(httpd, EXIT_FAILURE, in bozo_ssl_init()
285 bozo_ssl_err(httpd, EXIT_FAILURE, in bozo_ssl_init()
291 bozo_ssl_err(httpd, EXIT_FAILURE, in bozo_ssl_init()
299 bozo_ssl_accept(bozohttpd_t *httpd) in bozo_ssl_accept() argument
301 sslinfo_t *sslinfo = httpd->sslinfo; in bozo_ssl_accept()
306 alarm(httpd->ssl_timeout); in bozo_ssl_accept()
310 bozoerr(httpd, 1, "SSL_new failed"); in bozo_ssl_accept()
316 bozo_check_error_queue(httpd, "accept", ret); in bozo_ssl_accept()
330 bozo_ssl_shutdown(bozohttpd_t *httpd) in bozo_ssl_shutdown() argument
332 const sslinfo_t *sslinfo = httpd->sslinfo; in bozo_ssl_shutdown()
339 bozo_ssl_destroy(bozohttpd_t *httpd) in bozo_ssl_destroy() argument
341 const sslinfo_t *sslinfo = httpd->sslinfo; in bozo_ssl_destroy()
348 bozo_get_sslinfo(bozohttpd_t *httpd) in bozo_get_sslinfo() argument
351 if (httpd->sslinfo) in bozo_get_sslinfo()
352 return httpd->sslinfo; in bozo_get_sslinfo()
353 sslinfo = bozomalloc(httpd, sizeof(*sslinfo)); in bozo_get_sslinfo()
355 bozoerr(httpd, 1, "sslinfo allocation failed"); in bozo_get_sslinfo()
357 return httpd->sslinfo = sslinfo; in bozo_get_sslinfo()
361 bozo_ssl_set_opts(bozohttpd_t *httpd, const char *cert, const char *priv) in bozo_ssl_set_opts() argument
363 sslinfo_t *sslinfo = bozo_get_sslinfo(httpd); in bozo_ssl_set_opts()
365 sslinfo->certificate_file = bozostrdup(httpd, NULL, cert); in bozo_ssl_set_opts()
366 sslinfo->privatekey_file = bozostrdup(httpd, NULL, priv); in bozo_ssl_set_opts()
367 debug((httpd, DEBUG_NORMAL, "using cert/priv files: %s & %s", in bozo_ssl_set_opts()
370 if (!httpd->bindport) in bozo_ssl_set_opts()
371 httpd->bindport = bozostrdup(httpd, NULL, BOZO_HTTPS_PORT); in bozo_ssl_set_opts()
375 bozo_ssl_set_ciphers(bozohttpd_t *httpd, const char *ciphers) in bozo_ssl_set_ciphers() argument
377 sslinfo_t *sslinfo = bozo_get_sslinfo(httpd); in bozo_ssl_set_ciphers()
379 sslinfo->ciphers = bozostrdup(httpd, NULL, ciphers); in bozo_ssl_set_ciphers()
380 debug((httpd, DEBUG_NORMAL, "using ciphers: %s", sslinfo->ciphers)); in bozo_ssl_set_ciphers()
390 bozo_printf(bozohttpd_t *httpd, const char *fmt, ...) in bozo_printf() argument
395 USE_ARG(httpd); in bozo_printf()
399 if (httpd->sslinfo) in bozo_printf()
400 cc = bozo_ssl_printf(httpd, fmt, args); in bozo_printf()
409 bozo_read(bozohttpd_t *httpd, int fd, void *buf, size_t len) in bozo_read() argument
412 if (httpd->sslinfo) in bozo_read()
413 return bozo_ssl_read(httpd, fd, buf, len); in bozo_read()
415 USE_ARG(httpd); in bozo_read()
420 bozo_write(bozohttpd_t *httpd, int fd, const void *buf, size_t len) in bozo_write() argument
423 if (httpd->sslinfo) in bozo_write()
424 return bozo_ssl_write(httpd, fd, buf, len); in bozo_write()
426 USE_ARG(httpd); in bozo_write()
431 bozo_flush(bozohttpd_t *httpd, FILE *fp) in bozo_flush() argument
434 if (httpd->sslinfo) in bozo_flush()
437 USE_ARG(httpd); in bozo_flush()