}
/*
- * Simple application to send a basic HTTP/1.0 request to a server and
- * print the response on the screen. Note that HTTP/1.0 over QUIC is
+ * Simple application to send a basic HTTP/1.1 request to a server and
+ * print the response on the screen. Note that HTTP/1.1 over QUIC is
* non-standard and will not typically be supported by real world servers. This
* is for demonstration purposes only.
*/
BIO *bio = NULL;
int res = EXIT_FAILURE;
int ret;
- unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '0' };
- const char *request_start = "GET / HTTP/1.0\r\nConnection: close\r\nHost: ";
+ unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '1' };
+ const char *request_start = "GET / HTTP/1.1\r\nConnection: close\r\nHost: ";
const char *request_end = "\r\n\r\n";
size_t written, readbytes;
char buf[160];
}
}
/*
- * Simple application to send a basic HTTP/1.0 request to a server and
- * print the response on the screen. Note that HTTP/1.0 over QUIC is
+ * Simple application to send a basic HTTP/1.1 request to a server and
+ * print the response on the screen. Note that HTTP/1.1 over QUIC is
* non-standard and will not typically be supported by real world servers. This
* is for demonstration purposes only.
*/
BIO *bio = NULL;
int res = EXIT_FAILURE;
int ret;
- unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '0' };
- const char *request_start = "GET / HTTP/1.0\r\nConnection: close\r\nHost: ";
+ unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '1' };
+ const char *request_start = "GET / HTTP/1.1\r\nConnection: close\r\nHost: ";
const char *request_end = "\r\n\r\n";
size_t written, readbytes = 0;
char buf[160];
}
/*
- * Simple application to send basic HTTP/1.0 requests to a server and print the
- * response on the screen. Note that HTTP/1.0 over QUIC is not a real protocol
+ * Simple application to send basic HTTP/1.1 requests to a server and print the
+ * response on the screen. Note that HTTP/1.1 over QUIC is not a real protocol
* and will not be supported by real world servers. This is for demonstration
* purposes only.
*/
BIO *bio = NULL;
int res = EXIT_FAILURE;
int ret;
- unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '0' };
- const char *request1_start = "GET /request1.html HTTP/1.0\r\nConnection: close\r\nHost: ";
- const char *request2_start = "GET /request2.html HTTP/1.0\r\nConnection: close\r\nHost: ";
+ unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '1' };
+ const char *request1_start = "GET /request1.html HTTP/1.1\r\nConnection: close\r\nHost: ";
+ const char *request2_start = "GET /request2.html HTTP/1.1\r\nConnection: close\r\nHost: ";
size_t readbytes;
char buf[160];
BIO_ADDR *peer_addr = NULL;
}
/*
- * In our hypothetical HTTP/1.0 over QUIC protocol that we are using we
+ * In our hypothetical HTTP/1.1 over QUIC protocol that we are using we
* assume that the server will respond with a server initiated stream
* containing the data requested in our uni-directional stream. This doesn't
* really make sense to do in a real protocol, but its just for
return ok;
}
-/* Minimal QUIC HTTP/1.0 server. */
+/* Minimal QUIC HTTP/1.1 server. */
int main(int argc, char *argv[])
{
int res = EXIT_FAILURE;
return ok;
}
-/* Minimal QUIC HTTP/1.0 server. */
+/* Minimal QUIC HTTP/1.1 server. */
int main(int argc, char *argv[])
{
int res = EXIT_FAILURE;
}
/*
- * Simple application to send a basic HTTP/1.0 request to a server and
+ * Simple application to send a basic HTTP/1.1 request to a server and
* print the response on the screen.
*/
int main(int argc, char *argv[])
BIO *bio = NULL;
int res = EXIT_FAILURE;
int ret;
- const char *request_start = "GET / HTTP/1.0\r\nConnection: close\r\nHost: ";
+ const char *request_start = "GET / HTTP/1.1\r\nConnection: close\r\nHost: ";
const char *request_end = "\r\n\r\n";
size_t written, readbytes;
char buf[160];
}
/*
- * Simple application to send a basic HTTP/1.0 request to a server and
+ * Simple application to send a basic HTTP/1.1 request to a server and
* print the response on the screen.
*/
int main(int argc, char *argv[])
BIO *bio = NULL;
int res = EXIT_FAILURE;
int ret;
- const char *request_start = "GET / HTTP/1.0\r\nConnection: close\r\nHost: ";
+ const char *request_start = "GET / HTTP/1.1\r\nConnection: close\r\nHost: ";
const char *request_end = "\r\n\r\n";
size_t written, readbytes = 0;
char buf[160];
This page will present various source code samples demonstrating how to write
a simple blocking QUIC client application which connects to a server, sends an
-HTTP/1.0 request to it, and reads back the response. Note that HTTP/1.0 over
+HTTP/1.1 request to it, and reads back the response. Note that HTTP/1.1 over
QUIC is non-standard and will not be supported by real world servers. This is
for demonstration purposes only.
it. However QUIC mandates that the TLS handshake used in establishing a QUIC
connection must use ALPN.
- unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '0' };
+ unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '1' };
/* SSL_set_alpn_protos returns 0 for success! */
if (SSL_set_alpn_protos(ssl, alpn, sizeof(alpn)) != 0) {
The ALPN is specified using a length prefixed array of unsigned chars (it is not
a NUL terminated string). Our original TLS blocking client demo was using
-HTTP/1.0. We will use the same for this example. Unlike most OpenSSL functions
+HTTP/1.1. We will use the same for this example. Unlike most OpenSSL functions
L<SSL_set_alpn_protos(3)> returns zero for success and nonzero for failure.
=head2 Setting the peer address
This section will present various source code samples demonstrating how to write
a simple multi-stream QUIC client application which connects to a server, send
-some HTTP/1.0 requests to it, and read back the responses. Note that HTTP/1.0
+some HTTP/1.1 requests to it, and read back the responses. Note that HTTP/1.1
over QUIC is non-standard and will not be supported by real world servers. This
is for demonstration purposes only.
return B<NULL>.
/*
- * In our hypothetical HTTP/1.0 over QUIC protocol that we are using we
+ * In our hypothetical HTTP/1.1 over QUIC protocol that we are using we
* assume that the server will respond with a server initiated stream
* containing the data requested in our uni-directional stream. This doesn't
* really make sense to do in a real protocol, but its just for
connection at a time, echoing input from the client back to the same client.
Once the current client disconnects, the next client connection is accepted.
-The server only accepts HTTP/1.0 requests, which is non-standard and will not
+The server only accepts HTTP/1.1 requests, which is non-standard and will not
be supported by real world servers. This is for demonstration purposes only.
Both the accepting socket and client connections are "blocking". A more typical
/* Setup ALPN negotiation callback to decide which ALPN is accepted. */
SSL_CTX_set_alpn_select_cb(ctx, select_alpn, NULL);
-In this case, we only accept "http/1.0" and "hq-interop".
+In this case, we only accept "http/1.1" and "hq-interop".
/*
- * ALPN strings for TLS handshake. Only 'http/1.0' and 'hq-interop'
+ * ALPN strings for TLS handshake. Only 'http/1.1' and 'hq-interop'
* are accepted.
*/
static const unsigned char alpn_ossltest[] = {
- 8, 'h', 't', 't', 'p', '/', '1', '.', '0',
+ 8, 'h', 't', 't', 'p', '/', '1', '.', '1',
10, 'h', 'q', '-', 'i', 'n', 't', 'e', 'r', 'o', 'p',
};
connection at a time, echoing input from the client back to the same client.
Once the current client disconnects, the next client connection is accepted.
-The server only accepts C<http/1.0> and C<hq-interop> ALPN's and doesn't actually
+The server only accepts C<http/1.1> and C<hq-interop> ALPN's and doesn't actually
implement HTTP but only does a simple echo. This is non-standard and will not
be supported by real world servers. This is for demonstration purposes only.
There are various methods to test this server: B<quic-client-block.c> and
-B<quic-client-non-block.c> will send a basic HTTP/1.0 request, which the server
+B<quic-client-non-block.c> will send a basic HTTP/1.1 request, which the server
will echo back. You can also test this server by running
-C<openssl s_client -connect localhost:4443 -4 -quic -alpn http/1.0> and entering
+C<openssl s_client -connect localhost:4443 -4 -quic -alpn http/1.1> and entering
text that will be echoed back by the server.
Both the listening socket and connected socket are "nonblocking". However,
/* Setup ALPN negotiation callback to decide which ALPN is accepted. */
SSL_CTX_set_alpn_select_cb(ctx, select_alpn, NULL);
-In this case, we only accept "http/1.0" and "hq-interop".
+In this case, we only accept "http/1.1" and "hq-interop".
/*
- * ALPN strings for TLS handshake. Only 'http/1.0' and 'hq-interop'
+ * ALPN strings for TLS handshake. Only 'http/1.1' and 'hq-interop'
* are accepted.
*/
static const unsigned char alpn_ossltest[] = {
- 8, 'h', 't', 't', 'p', '/', '1', '.', '0',
+ 8, 'h', 't', 't', 'p', '/', '1', '.', '1',
10, 'h', 'q', '-', 'i', 'n', 't', 'e', 'r', 'o', 'p',
};
=head1 SIMPLE BLOCKING TLS CLIENT EXAMPLE
This page will present various source code samples demonstrating how to write
-a simple TLS client application which connects to a server, sends an HTTP/1.0
+a simple TLS client application which connects to a server, sends an HTTP/1.1
request to it, and reads back the response.
We use a blocking socket for the purposes of this example. This means that
we are sending the request to. Finally we send the end of the request.
size_t written;
- const char *request_start = "GET / HTTP/1.0\r\nConnection: close\r\nHost: ";
+ const char *request_start = "GET / HTTP/1.1\r\nConnection: close\r\nHost: ";
const char *request_end = "\r\n\r\n";
/* Write an HTTP GET request to the peer */