diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-09 20:10:32 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-09 20:22:50 -0800 |
| commit | cbe9a27ef7485977fbc7c713376b096b6723da3d (patch) | |
| tree | baba50d93018ac6ce6873be46284f5f893da6e39 /src/sp/transport/ws | |
| parent | 0058b766b91f08b34dcef3c7bb55b216099f3f66 (diff) | |
| download | nng-cbe9a27ef7485977fbc7c713376b096b6723da3d.tar.gz nng-cbe9a27ef7485977fbc7c713376b096b6723da3d.tar.bz2 nng-cbe9a27ef7485977fbc7c713376b096b6723da3d.zip | |
websocket: Do not allow a listener or dialer to change TLS while running
This also covers a few test cases that we were missing.
Diffstat (limited to 'src/sp/transport/ws')
| -rw-r--r-- | src/sp/transport/ws/ws_test.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sp/transport/ws/ws_test.c b/src/sp/transport/ws/ws_test.c index 9115338f..0f514cfe 100644 --- a/src/sp/transport/ws/ws_test.c +++ b/src/sp/transport/ws/ws_test.c @@ -170,11 +170,31 @@ test_ws_recv_max(void) NUTS_CLOSE(s1); } +void +test_ws_no_tls(void) +{ + nng_socket s0; + nng_listener l; + nng_dialer d; + char *addr; + nng_tls_config *tls; + + NUTS_ADDR(addr, "ws"); + NUTS_OPEN(s0); + NUTS_PASS(nng_listener_create(&l, s0, addr)); + NUTS_FAIL(nng_listener_get_tls(l, &tls), NNG_ENOTSUP); + + NUTS_PASS(nng_dialer_create(&d, s0, addr)); + NUTS_FAIL(nng_dialer_get_tls(d, &tls), NNG_ENOTSUP); + NUTS_CLOSE(s0); +} + TEST_LIST = { { "ws url path filters", test_ws_url_path_filters }, { "ws wild card port", test_wild_card_port }, { "ws wild card host", test_wild_card_host }, { "ws empty host", test_empty_host }, { "ws recv max", test_ws_recv_max }, + { "ws no tls", test_ws_no_tls }, { NULL, NULL }, }; |
