diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-01-22 14:05:10 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-01-22 17:11:58 -0800 |
| commit | 3d075fad7496ec126c5087d1c36ab7a4af73ce16 (patch) | |
| tree | c5b5d6fe44eaa2996310683b5080de87160b9b41 /tests/wssfile.c | |
| parent | 5b1a3af7be4ae712868ae84b9a7d5a974d272b16 (diff) | |
| download | nng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.tar.gz nng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.tar.bz2 nng-3d075fad7496ec126c5087d1c36ab7a4af73ce16.zip | |
fixes #219 transports should take URL structure instead of string address
This eliminates a bunch of redundant URL parsing, using the common
URL logic we already have in place.
While here I fixed a problem with the TLS and WSS test suites that
was failing on older Ubuntu -- apparently older versions of mbedTLS
were unhappy if selecting OPTIONAL verification without a validate
certificate chain.
Diffstat (limited to 'tests/wssfile.c')
| -rw-r--r-- | tests/wssfile.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/wssfile.c b/tests/wssfile.c index 28cdf6b6..73bc1cdb 100644 --- a/tests/wssfile.c +++ b/tests/wssfile.c @@ -295,6 +295,7 @@ TestMain("WebSocket Secure (TLS) Transport (file based)", { nng_socket s1; nng_socket s2; nng_listener l; + nng_dialer d; char addr[NNG_MAXADDRLEN]; nng_msg * msg; nng_pipe p; @@ -314,10 +315,20 @@ TestMain("WebSocket Secure (TLS) Transport (file based)", { // reset port back one trantest_prev_address(addr, "wss://127.0.0.1:%u/test"); + So(nng_setopt_ms(s2, NNG_OPT_RECVTIMEO, 200) == 0); + So(nng_dialer_create(&d, s2, addr) == 0); + So(init_dialer_wss_file(NULL, d) == 0); + So(nng_dialer_setopt_int(d, NNG_OPT_TLS_AUTH_MODE, + NNG_TLS_AUTH_MODE_OPTIONAL) == 0); + So(nng_dialer_setopt_string( + d, NNG_OPT_TLS_SERVER_NAME, "example.com") == 0); + So(nng_dialer_start(d, 0) == 0); +#if 0 So(nng_setopt_int(s2, NNG_OPT_TLS_AUTH_MODE, NNG_TLS_AUTH_MODE_OPTIONAL) == 0); So(nng_setopt_ms(s2, NNG_OPT_RECVTIMEO, 200) == 0); So(nng_dial(s2, addr, NULL, 0) == 0); +#endif nng_msleep(100); So(nng_send(s1, "hello", 6, 0) == 0); |
