diff options
Diffstat (limited to 'tests/tls.c')
| -rw-r--r-- | tests/tls.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/tls.c b/tests/tls.c index 31041fa5..f51fabef 100644 --- a/tests/tls.c +++ b/tests/tls.c @@ -9,7 +9,9 @@ // #include "convey.h" + #include "nng.h" + #include "protocol/pair1/pair.h" #include "supplemental/tls/tls.h" #include "transport/tls/tls.h" @@ -293,6 +295,26 @@ TestMain("TLS Transport", { So(nng_dial(s2, addr, NULL, 0) == 0); }); + Convey("We can bind to port zero", { + nng_socket s1; + nng_socket s2; + nng_listener l; + char addr[NNG_MAXADDRLEN]; + size_t sz; + + So(nng_tls_register() == 0); + So(nng_pair_open(&s1) == 0); + So(nng_pair_open(&s2) == 0); + Reset({ + nng_close(s2); + nng_close(s1); + }); + So(nng_listen(s1, "tls+tcp://127.0.0.1:0", &l, 0) == 0); + sz = NNG_MAXADDRLEN; + So(nng_listener_getopt(l, NNG_OPT_URL, addr, &sz) == 0); + So(nng_dial(s2, addr, NULL, 0) == 0); + }); + Convey("Malformed TLS addresses do not panic", { nng_socket s1; |
