I added two lines to set alpn and it's now working.
tlsuv_stream_t stream;
tlsuv_stream_init(get_uv_loop(), &mbed, NULL);
// Following two lines fixed segfaults and I got a working TLS connection
const char *alpn[] = { "http/1.1" };
tlsuv_stream_set_protocols(&mbed, 1, alpn);
I sort of expected tlsuv_stream_init to give me something that at least would not lead to segfault. Feels like ALPN count field should default to 0, i.e. not using ALPN, right?
ISTM that after the merge of ALPN support in #165 we must initialize by setting ALPN protocols, right?
I followed sample.c (https://github.com/openziti/tlsuv/blob/main/sample/sample.c) and ended up with a segfaulting program. It died trying to work with alpn_count & alpn_protocols field in a struct. I don't see those being initialized.
I added two lines to set alpn and it's now working.
I noticed https://github.com/openziti/tlsuv/commit/2e8dd315e80fa091c801390e816fe86027b2dfa3 that fixes the engine sample. Should sample.c also be updated or what is the API here?
I sort of expected
tlsuv_stream_init
to give me something that at least would not lead to segfault. Feels like ALPN count field should default to 0, i.e. not using ALPN, right?