zeek/testing/btest/cluster/websocket/tls-usage-error.zeek
Arne Welzel 2ee2e3b062 Merge remote-tracking branch 'origin/topic/awelzel/4474-cluster-websocket-ipv6'
* origin/topic/awelzel/4474-cluster-websocket-ipv6:
  IXWebsocket: Bump to version with memset() sock addr fix
  cluster/websocket: Deprecate $listen_host, introduce $listen_addr
  cluster/websocket-ixwebsocket: Determine proper address_family

(cherry picked from commit f16ebd34b3)
2025-07-14 14:20:41 -07:00

19 lines
654 B
Text

# @TEST-DOC: Calling listen_websocket() with badly configured WebSocketTLSOptions.
#
# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
event zeek_init()
{
local tls_options_no_key = Cluster::WebSocketTLSOptions(
$cert_file="../localhost.crt",
);
local tls_options_no_cert = Cluster::WebSocketTLSOptions(
$key_file="../localhost.key",
);
assert ! Cluster::listen_websocket([$listen_addr=127.0.0.1, $listen_port=1234/tcp, $tls_options=tls_options_no_key]);
assert ! Cluster::listen_websocket([$listen_addr=127.0.0.1, $listen_port=1234/tcp, $tls_options=tls_options_no_cert]);
}