mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00

This only changes the script-layer API, but keeps the std::string host in the C++ layer's ServerOptions. Mostly because the ixwebsocket library takes host as std::string. Also, maybe at some point we'd want to support something scheme-based like unix:///var/run/zeek.sock and placing that in a string could not be totally wrong. Add tests for IPV6, too.
19 lines
654 B
Text
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]);
|
|
}
|