goto end;
}
#endif
- if (early_data && (www > 0 || rev)) {
+ if (early_data && rev) {
BIO_printf(bio_err,
- "Can't use -early_data in combination with -www, -WWW, -HTTP, or -rev\n");
+ "Can't use -early_data in combination with -rev\n");
goto end;
}
int i, j, k, dot;
SSL *con;
const SSL_CIPHER *c;
- BIO *io, *ssl_bio, *sbio;
+ BIO *io, *ssl_bio, *sbio, *edio;
#ifdef RENEG
int total_bytes = 0;
#endif
p = buf = app_malloc(bufsize + 1, "server www buffer");
io = BIO_new(BIO_f_buffer());
ssl_bio = BIO_new(BIO_f_ssl());
- if ((io == NULL) || (ssl_bio == NULL))
+ edio = BIO_new(BIO_s_mem());
+ if ((io == NULL) || (ssl_bio == NULL) || (edio == NULL))
goto err;
if (s_nbio) {
goto err;
io = BIO_push(filter, io);
+
+ filter = BIO_new(BIO_f_ebcdic_filter());
+ if (filter == NULL)
+ goto err;
+
+ edio = BIO_push(filter, edio);
#endif
if (s_debug) {
SSL_set_msg_callback_arg(con, bio_s_msg ? bio_s_msg : bio_s_out);
}
+ if (early_data) {
+ int edret = SSL_READ_EARLY_DATA_ERROR;
+ size_t readbytes;
+
+ while (edret != SSL_READ_EARLY_DATA_FINISH) {
+ for (;;) {
+ edret = SSL_read_early_data(con, buf, bufsize, &readbytes);
+ if (edret != SSL_READ_EARLY_DATA_ERROR)
+ break;
+
+ switch (SSL_get_error(con, 0)) {
+ case SSL_ERROR_WANT_WRITE:
+ case SSL_ERROR_WANT_ASYNC:
+ case SSL_ERROR_WANT_READ:
+ /* Just keep trying - busy waiting */
+ continue;
+ default:
+ BIO_printf(bio_err, "Error reading early data\n");
+ ERR_print_errors(bio_err);
+ goto err;
+ }
+ }
+ if (readbytes > 0)
+ BIO_write(edio, buf, (int)readbytes);
+ }
+ }
+
for (;;) {
- i = BIO_gets(io, buf, bufsize + 1);
+ i = BIO_gets(!BIO_eof(edio) ? edio : io, buf, bufsize + 1);
if (i < 0) { /* error */
if (!BIO_should_retry(io) && !SSL_waiting_for_async(con)) {
if (!s_quiet)
OPENSSL_free(buf);
BIO_free(ssl_bio);
BIO_free_all(io);
+ BIO_free_all(edio);
return ret;
}
The output is in HTML format so this option can be used with a web browser.
The special URL C</renegcert> turns on client cert validation, and C</reneg>
tells the server to request renegotiation.
-The B<-early_data> option cannot be used with this option.
=item B<-WWW>, B<-HTTP>
C<text/plain>.
In addition, the special URL C</stats> will return status
information like the B<-www> option.
-Neither of these options can be used in conjunction with B<-early_data>.
=item B<-http_server_binmode>