Add version parameter and draft-14 mode for demo server.
@@ -395,7 +395,7 @@ int quic_server(const char* server_name, int server_port,
const char* pem_cert, const char* pem_key,
int just_once, int do_hrr, cnx_id_cb_fn cnx_id_callback,
void* cnx_id_callback_ctx, uint8_t reset_seed[PICOQUIC_RESET_SECRET_SIZE],
- int mtu_max)
+ int mtu_max, uint32_t proposed_version)
{
/* Start: start the QUIC process with cert and key files */
int ret = 0;
@@ -440,6 +440,11 @@ int quic_server(const char* server_name, int server_port,
PICOQUIC_SET_LOG(qserver, stdout);
picoquic_set_key_log_file_from_env(qserver);
+
+ if (proposed_version == PICOQUIC_SEVENTH_INTEROP_VERSION ||
+ proposed_version == PICOQUIC_EIGHT_INTEROP_VERSION) {
+ picoquic_set_tls_context_for_draft_14(qserver);
+ }
}
}
@@ -1281,7 +1286,8 @@ void usage()
fprintf(stderr, " where <src> is int:\n");
fprintf(stderr, " 0: picoquic_cnx_id_random\n");
fprintf(stderr, " 1: picoquic_cnx_id_remote (client)\n");
- fprintf(stderr, " -v version Version proposed by client, e.g. -v ff00000a\n");
+ fprintf(stderr, " -v version Version proposed by client, e.g. -v ff00000e\n");
+ fprintf(stderr, " or restrict the server to draft-14 mode.\n");
fprintf(stderr, " -z Set TLS zero share behavior on client, to force HRR.\n");
fprintf(stderr, " -f migration_mode Force client to migrate to start migration:\n");
fprintf(stderr, " -f 1 test NAT rebinding,\n");
@@ -1465,7 +1471,7 @@ int main(int argc, char** argv)
/* TODO: find an alternative to using 64 bit mask. */
(cnx_id_mask_is_set == 0) ? NULL : cnx_id_callback,
(cnx_id_mask_is_set == 0) ? NULL : (void*)&cnx_id_cbdata,
- (uint8_t*)reset_seed, mtu_max);
+ (uint8_t*)reset_seed, mtu_max, proposed_version);
printf("Server exit with code = %d\n", ret);
} else {
FILE* F_log = NULL;
