Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/listeners #4452

Merged
merged 184 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
77df3a9
Split ejabberd_service behaviours into new modules
NelsonVides Dec 5, 2024
db8f135
Cleanup component_SUITE
NelsonVides Dec 17, 2024
139d1d7
Migrate components listener to a ranch supervision
NelsonVides Dec 5, 2024
999d545
Add new config keys for the ranch listener
NelsonVides Dec 5, 2024
b63a8e8
Change shaper_rule into shaper for components config
NelsonVides Dec 13, 2024
1f9b48d
Save component namespace into mongoose_ns.hrl
NelsonVides Dec 17, 2024
c177133
Implement components as a gen_statem over ranch
NelsonVides Dec 17, 2024
5b2856e
Fix answering with the from as it was requested
NelsonVides Dec 20, 2024
284bd1c
Refactor and cleanup order of code, comments, and reduce module number
NelsonVides Dec 30, 2024
3e907e1
Rework components tests to introduce independence and parallelism
NelsonVides Dec 20, 2024
02aab44
Update old documentation about routing tables
NelsonVides Dec 31, 2024
d10da98
Support dynamic domains for components
NelsonVides Dec 31, 2024
9afc32c
Remove mod_disco extra_domains config key
NelsonVides Dec 31, 2024
e8c71e9
Merge pull request #4442 from esl/xmpp_services
telezynski Jan 2, 2025
09f5365
Merge pull request #4450 from esl/components/dynamic_domains
telezynski Jan 2, 2025
00a4c4b
Rename components as components instead of the old services
NelsonVides Dec 31, 2024
e537234
Update reuseport available since OTP26
NelsonVides Jan 2, 2025
749ffe4
Match listeners module strictly
NelsonVides Jan 2, 2025
14798b9
Process ip_version in config to what it will finally be used instead …
NelsonVides Jan 2, 2025
bb64aa6
Add just_tls to services listener config
NelsonVides Dec 31, 2024
71d0ce3
Merge pull request #4451 from esl/components/rename_from_services
telezynski Jan 3, 2025
d653dc2
Introduce TLS listeners for components
NelsonVides Jan 2, 2025
fac8b50
Merge pull request #4453 from esl/components/tls
telezynski Jan 3, 2025
841196c
Move s2s files to s2s dir
NelsonVides Jan 2, 2025
6db04ab
Remove ejabberd_s2s_in:start/2
NelsonVides Jan 7, 2025
b29cb45
Remove listener callbacks from ejabberd_s2s_in
NelsonVides Jan 7, 2025
256deb5
Extract common XMPP configuration flags
NelsonVides Jan 2, 2025
e7478cd
Rework configuration to unify listeners
NelsonVides Jan 3, 2025
685f39d
Minimally update information on TLS hardening
NelsonVides Jan 3, 2025
cc7ea17
Remove mongoose tcp listener
NelsonVides Jan 7, 2025
c489cde
Implement S2S listeners in ranch
NelsonVides Jan 7, 2025
c671e34
Refactor listener logic to make code common
NelsonVides Jan 7, 2025
7ca81f8
Fix sasl_external
NelsonVides Jan 7, 2025
a623aea
Remove server-side helper for mim_transport unused since the s2s sock…
NelsonVides Jan 10, 2025
cc33ba6
Remove fast_tls from the configuration
NelsonVides Jan 8, 2025
e801a2d
Unify tls configs for components
NelsonVides Jan 8, 2025
07e5a12
Remove documentation about fast_tls hardening
NelsonVides Jan 9, 2025
0f2c4a4
Remove fast_tls from documentation and required tests
NelsonVides Jan 9, 2025
dcc189e
TODO: Escalus on master works, rebase on future new release
NelsonVides Jan 9, 2025
954bb93
Implement TLSv1.3 tls-exporter channel binding
NelsonVides Jan 9, 2025
8b3eb91
Remove fast_tls from big_tests
NelsonVides Jan 9, 2025
a800222
Remove fast_tls from sockets
NelsonVides Jan 9, 2025
49022f8
Rework S2S in and out sockets and TLS configuration
NelsonVides Jan 10, 2025
cd88762
Simplify mongoose_tls into just_tls
NelsonVides Jan 10, 2025
603a5ce
Fix global_distrib sockets
NelsonVides Jan 10, 2025
abee869
Merge pull request #4455 from esl/s2s/listeners
telezynski Jan 14, 2025
2a270c4
Apply review
NelsonVides Jan 14, 2025
0b0083b
Merge pull request #4458 from esl/listeners/ssl
arcusfelis Jan 14, 2025
bdc5eb1
Reimplement adding dynamic domains to components
NelsonVides Jan 13, 2025
b26af9d
Merge pull request #4461 from esl/dynamic_domains/components
chrzaszcz Jan 16, 2025
9b8212b
Move listener_id helper into mongoose_listener
NelsonVides Jan 10, 2025
0eb38ad
Unify start_listener api specs
NelsonVides Jan 10, 2025
54a00dd
Make hibernate_after common for all listeners
NelsonVides Jan 10, 2025
154bae7
Pass hibernate_after to cowboy over https
NelsonVides Jan 11, 2025
abf0169
Remove unused callback from ejabberd_cowboy
NelsonVides Jan 11, 2025
722ade6
Implement child_spec in mongoose_listener
NelsonVides Jan 10, 2025
d76b43c
Make listeners code more common
NelsonVides Jan 10, 2025
83ff621
Generalise transport and socket logic
NelsonVides Jan 13, 2025
c968b41
Apply review
NelsonVides Jan 16, 2025
72e0b9e
Merge pull request #4460 from esl/listeners/unification
chrzaszcz Jan 17, 2025
b828652
Merge branch 'master' into feature/listeners
NelsonVides Jan 19, 2025
63591f6
Merge branch 'master' into feature/listeners
NelsonVides Jan 20, 2025
829e566
Merge branch 'master' into feature/listeners
NelsonVides Jan 21, 2025
9183e14
Improve the consistency of just_tls helpers
NelsonVides Jan 20, 2025
1d45385
Merge pull request #4467 from esl/just_tls_minor_improvements
arcusfelis Jan 22, 2025
16421a5
Remove domain_certfile config section
NelsonVides Jan 23, 2025
6f75bef
Remove very old s2s_out bugfix hack
NelsonVides Jan 23, 2025
d2a2332
Reduce very long timeouts in s2s_SUITE
NelsonVides Jan 23, 2025
847dd7e
Ensure timeout in ssl client connections
NelsonVides Jan 23, 2025
9da86b4
Optimise matching on attributes on stream_start
NelsonVides Jan 23, 2025
28fc6e5
Create a common XMPP socket module
NelsonVides Jan 23, 2025
56425c7
Unify TCP/TLS and XMPP instrumentation events by labels
NelsonVides Jan 23, 2025
e47a735
Rewrite S2S incoming connections as a gen_statem
NelsonVides Jan 23, 2025
32a247f
Remove old TLSv1.2 cipher where is not needed
NelsonVides Jan 23, 2025
a54efde
Improve listener tls type
NelsonVides Jan 23, 2025
06a7d3a
Simplify just_tls
NelsonVides Jan 23, 2025
733f856
early data wip
arcusfelis Jan 29, 2025
fdbad9b
Merge pull request #4470 from esl/listeners/socket_unification
DenysGonchar Jan 29, 2025
8936818
Merge branch 'master' into feature/listeners
NelsonVides Jan 30, 2025
46648e0
Allow to open remote shell to the test node
arcusfelis Feb 3, 2025
a774ba3
Fix listener docs about direct tls
arcusfelis Feb 3, 2025
41c5277
Receive tickets
arcusfelis Feb 3, 2025
6db60e2
Set use_ticket
arcusfelis Feb 3, 2025
8760cef
Set tickets
arcusfelis Feb 4, 2025
be46306
Early data tests work
arcusfelis Feb 4, 2025
1935adf
Update escalus
arcusfelis Feb 4, 2025
a610a89
Merge branch 'master' into feature/listeners
NelsonVides Feb 5, 2025
ce1b6be
Improve xmpp_socket send_xml spec
NelsonVides Jan 27, 2025
4e65d1c
Refine just_tls specs
NelsonVides Feb 4, 2025
a12cc76
Rename socket:new to socket:accept
NelsonVides Feb 1, 2025
6b69370
Relax xmpp_socket:tcp_to_tls specs
NelsonVides Feb 1, 2025
9320a70
Clean usage of jlib:replace_from_to*
NelsonVides Feb 4, 2025
88952f6
Optimise gen_servers
NelsonVides Feb 5, 2025
90d7a04
Improve typing information for ejabberd_s2s
NelsonVides Feb 4, 2025
cf0c309
Add xmpp_router behaviour specs to implementations
NelsonVides Feb 4, 2025
256f34b
Extend s2s outgoing config
NelsonVides Feb 1, 2025
e858109
Implement module with RFC6120 and XEP-0368 DNS discovery rules
NelsonVides Feb 5, 2025
08dc9b6
Introduce xmpp_socket:tcp_to_tls for the client side
NelsonVides Feb 4, 2025
eb2a51b
Introduce xmpp_socket:connect/ API
NelsonVides Feb 4, 2025
81849b8
Reorganise mongoose_s2s_dialback
NelsonVides Feb 4, 2025
23644bd
Rework s2s out connections
NelsonVides Feb 4, 2025
35f7baa
Add options for listeners for early_data and session_tickets
arcusfelis Feb 6, 2025
24ba096
Merge pull request #4480 from esl/minor_optimisations_and_cleanups
chrzaszcz Feb 7, 2025
b795fce
Return more explicit errors and failures on WS and BOSH tls callbacks
NelsonVides Feb 11, 2025
b2b92c9
domain_utf8_to_ascii return type based on an input parameter instead …
NelsonVides Feb 11, 2025
0a0659b
Unify tcp_to_tls client and server clauses
NelsonVides Feb 11, 2025
e70c80a
Fix small boolean and arithmetic logic in some new functions
NelsonVides Feb 11, 2025
ed4c58c
Merge pull request #4479 from esl/s2s/out_rework
DenysGonchar Feb 11, 2025
ae010af
Merge branch 'master' into feature/listeners
NelsonVides Feb 11, 2025
bb4ca12
Add set_count|set_current actions
arcusfelis Feb 12, 2025
c183fcb
Add set_count/set_current callbacks into backend module
arcusfelis Feb 12, 2025
6f3c92b
Implement fast_set_count SQL request
arcusfelis Feb 12, 2025
b9ac68a
Set count into set_current map
arcusfelis Feb 12, 2025
4af08f6
Check token count when checking the token during the auth
arcusfelis Feb 12, 2025
cc67c54
Fix compilation warnings (unused vars)
arcusfelis Feb 12, 2025
075a3ed
Fix dialyzer
arcusfelis Feb 12, 2025
4a6b761
Move early_data, session_tickets into the correct config spec section
arcusfelis Feb 13, 2025
7a31fd5
Fix odbc preset for fast_auth_token_SUITE
arcusfelis Feb 13, 2025
7b64dfa
Address review comments from Nelson
arcusfelis Feb 14, 2025
4f366b4
Use latest escalus version
arcusfelis Feb 14, 2025
9e7af04
Don't use escalus_ejabberd:rpc, use distributed_helper:rpc instead
arcusfelis Feb 14, 2025
7fc92bc
Merge pull request #4478 from esl/fast-0rtt
NelsonVides Feb 17, 2025
6e78eea
Add new methods for TLS exporter
arcusfelis Feb 20, 2025
b591338
Channel Binding basic tests work
arcusfelis Feb 20, 2025
430a8a2
MIM-2392 Do not require cacertfile in TLS config for peer verification
Feb 26, 2025
c846126
Disable tests for 0rtt and channel binding
arcusfelis Feb 27, 2025
3da46d3
Skip channel binding tests in erlan 26 (we still use it on CI)
arcusfelis Feb 27, 2025
92ed285
Document args for tls-exporter
arcusfelis Feb 27, 2025
19ef7ba
Merge pull request #4494 from esl/fast-auth-cb
NelsonVides Mar 4, 2025
1539fda
MIM-2392 Use OS provided CA certificates if certs are not provided in…
Feb 26, 2025
078a17d
MIM-2392 Fix config_parser tests
Feb 27, 2025
d9d2175
MIM-2392 Add test for using system certificates
Mar 4, 2025
9b22c7b
Merge pull request #4493 from esl/MIM-2392_system_ca_certificates
DenysGonchar Mar 5, 2025
01f66bf
MIM-2411 Remove `fast_tls` from big_tests rebar.lock
Mar 6, 2025
e55b09d
extending exometer_labels convertor
DenysGonchar Mar 11, 2025
372d878
fixing graphql_metric_SUITE
DenysGonchar Mar 11, 2025
43f7d26
MIM-2411 Fix documentation after removal of `just_tls`
Mar 6, 2025
9cda272
Merge pull request #4506 from esl/MIM-2411_listeners_docs
DenysGonchar Mar 12, 2025
14bf319
extending mongoose_instrument_metrics_SUITE
DenysGonchar Mar 11, 2025
d3ce54b
removing logs from tests
DenysGonchar Mar 11, 2025
d5662df
Merge pull request #4507 from esl/updating-exometer_labels-converter
chrzaszcz Mar 13, 2025
667eb26
updating description of xmpp_element_size_* metrics
DenysGonchar Mar 13, 2025
505d0ff
updating description of tcp_data_*/tls_data_* metrics
DenysGonchar Mar 13, 2025
9df575b
getting rid of http connection_type for tcp/tls data in/out metrics
DenysGonchar Mar 13, 2025
fab11c3
Merge pull request #4504 from esl/documenting_metrics_changes
chrzaszcz Mar 17, 2025
a05390e
Merge branch 'master' into merge-master-to-listeners
chrzaszcz Mar 19, 2025
702a559
Merge pull request #4509 from esl/merge-master-to-listeners
telezynski Mar 19, 2025
6836480
Bring back the 'extra domains' feature
chrzaszcz Mar 20, 2025
0a5e1fe
Merge pull request #4512 from esl/listeners/bring-back-extra-domains
jacekwegr Apr 3, 2025
eb4f483
Fix indentation, typos and unused functions in component_SUITE
chrzaszcz Mar 20, 2025
e00915b
Add missing space in connect_SUITE
chrzaszcz Mar 20, 2025
416d834
Add fast_tls to rebar.lock for big tests
chrzaszcz Mar 20, 2025
249d141
Remove unnecessary leftovers and whitespace
chrzaszcz Mar 21, 2025
2e1b170
Merge pull request #4514 from esl/listeners/minor-corrections
jacekwegr Apr 3, 2025
93580ac
Prevent function_clause errors during s2s negotiation
chrzaszcz Apr 4, 2025
b18fe73
Test stream start errors during s2s negotiation
chrzaszcz Apr 4, 2025
c7ac61f
Merge pull request #4513 from esl/listeners/prevent-function-clause-i…
jacekwegr Apr 4, 2025
94d755a
Group all s2s outgoing options under s2s.outgoing
chrzaszcz Apr 4, 2025
68a30e5
Update config helper and test data after reorganizing s2s options
chrzaszcz Apr 4, 2025
efe1b2c
Update config_parser_SUITE after reorganizing s2s options
chrzaszcz Apr 4, 2025
498ec2e
Update TOML config after moving s2s options
chrzaszcz Apr 4, 2025
42516c8
Update s2s helper after reorganizing s2s configuration
chrzaszcz Apr 4, 2025
5315e76
Update S2S documentation after reorganizing s2s outgoing options
chrzaszcz Apr 4, 2025
23879ce
Remove a no-op with an irrelevant comment from tests
chrzaszcz Apr 4, 2025
e7f5695
Document state_timeout as applicable to all XMPP listeners
chrzaszcz Apr 4, 2025
51a41d8
Update description of the tls section for s2s and components
chrzaszcz Apr 4, 2025
edb2a27
Remove remaining references to 'just_tls'
chrzaszcz Apr 4, 2025
d1f3769
Fix minor issues in documentation
chrzaszcz Apr 4, 2025
5f41e5e
Resolve TODO in component_helper
chrzaszcz Mar 27, 2025
920b7af
Remove unused code and apply minor corrections in fast_auth_token
chrzaszcz Mar 27, 2025
63adc14
Get rid of the no-op function 'recv_data' from mod_global_distrib
chrzaszcz Mar 27, 2025
e3a603d
Minor corrections in mod_websockets
chrzaszcz Mar 28, 2025
631306b
Merge pull request #4515 from esl/listeners/organize-config-options
jacekwegr Apr 7, 2025
79e8f17
Merge pull request #4516 from esl/listeners/fixes
jacekwegr Apr 7, 2025
8d4a7ef
Don't call default_config for nested opts
chrzaszcz Apr 7, 2025
dd188b5
Extract XML element measurements to a separate module
chrzaszcz Apr 7, 2025
6b1524d
Use mongoose_measurements:measure_element/1 in mongoose_c2s
chrzaszcz Apr 7, 2025
f448316
Use mongoose_measurements in mongoose_component_connection
chrzaszcz Apr 7, 2025
959808d
Use mongoose_measurements:measure_element/1 in mongoose_s2s_in/out
chrzaszcz Apr 7, 2025
be4e2d9
Update instrumentation in component and s2s tests
chrzaszcz Apr 7, 2025
4234407
Add missing instrumentation for s2s_auth_failed
chrzaszcz Mar 28, 2025
a346065
Test remaining s2s events in s2s_SUITE
chrzaszcz Apr 8, 2025
757d023
Merge pull request #4517 from esl/listeners/improve-instrumentation
NelsonVides Apr 9, 2025
4d894fb
Merge branch 'master' into feature/listeners
chrzaszcz Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions big_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ else
TLS_DIST_OPTS :=
endif

REMSH_OPTS := -setcookie mongooseim \
$(TLS_DIST_OPTS)

COMMON_OPTS := -sname test -setcookie mongooseim -hidden \
$(TLS_DIST_OPTS) \
-env REPO_DIR "$(ABS_REPO_DIR)" \
Expand Down Expand Up @@ -72,6 +75,11 @@ test: $(PREPARE)
$(RUN) erl -noinput $(COMMON_OPTS) $(ADD_OPTS) \
-s run_common_test main test=full spec=$(TESTSPEC)

# Open remote shell to the test node
remsh:
erl $(REMSH_OPTS) $(ADD_OPTS) \
-remsh "test@$(shell hostname -s)" -sname remshnode

prepare: mim_ct_rest compile vm.dist.args
erlc -I_build/default/lib/exml/include \
run_common_test.erl
Expand Down
1 change: 0 additions & 1 deletion big_tests/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
{suites, "tests", xep_0352_csi_SUITE}.
{suites, "tests", domain_isolation_SUITE}.
{suites, "tests", domain_removal_SUITE}.
{suites, "tests", tcp_listener_SUITE}.
{suites, "tests", cets_disco_SUITE}.
{suites, "tests", start_node_id_SUITE}.
{suites, "tests", tr_util_SUITE}.
Expand Down
17 changes: 11 additions & 6 deletions big_tests/dynamic_domains.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
{cowboy_port, 5280},
{cowboy_secure_port, 5285},
{http_api_client_endpoint_port, 8089},
{service_port, 8888},
{kicking_service_port, 8666},
{hidden_service_port, 8189},
{component_port, 8888},
{kicking_component_port, 8666},
{hidden_component_port, 8189},
{tls_component_port, 8190},
{gd_endpoint_port, 5555},
{http_notifications_port, 8000}]},
{mim2, [{node, mongooseim2@localhost},
Expand All @@ -38,7 +39,7 @@
{c2s_tls_port, 5233},
{metrics_rest_port, 5289},
{gd_endpoint_port, 6666},
{service_port, 8899}]},
{component_port, 8899}]},
{mim3, [{node, mongooseim3@localhost},
{domain, <<"domain.example.com">>},
{host_type, <<"test type">>},
Expand Down Expand Up @@ -110,6 +111,11 @@
{server, <<"domain.example.com">>},
{host, <<"localhost">>},
{password, <<"nicniema">>}]},
{astrid, [
{username, <<"astrid">>},
{server, <<"sogndal">>},
{host, <<"localhost">>},
{password, <<"doctor">>}]},
{geralt, [
{username, <<"geralt">>},
{server, <<"domain.example.com">>},
Expand Down Expand Up @@ -162,8 +168,7 @@
{server, <<"domain.example.com">>},
{host, <<"localhost">>},
{password, <<"scramshaplus">>},
{starttls, required},
{tls_module, fast_tls}]},
{starttls, required}]},
{hacker, [
{username, <<"hacker">>},
{server, <<"domain.example.com">>},
Expand Down
2 changes: 1 addition & 1 deletion big_tests/dynamic_domains.spec
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
{suites, "tests", xep_0352_csi_SUITE}.
{suites, "tests", domain_removal_SUITE}.
{suites, "tests", local_iq_SUITE}.
{suites, "tests", tcp_listener_SUITE}.
{suites, "tests", cets_disco_SUITE}.
{suites, "tests", start_node_id_SUITE}.
{suites, "tests", tr_util_SUITE}.
Expand All @@ -108,6 +107,7 @@
%% to minimise impact on other tests
{suites, "tests", auth_methods_for_c2s_SUITE}.
{suites, "tests", cluster_commands_SUITE}.
{suites, "tests", component_SUITE}.
{suites, "tests", dynamic_domains_SUITE}.
{suites, "tests", graphql_server_SUITE}.
{suites, "tests", last_SUITE}.
Expand Down
6 changes: 1 addition & 5 deletions big_tests/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
{proper, "1.4.0"},
{gun, "2.1.0"},
{fusco, "0.1.1"},
{escalus, "4.3.0"},
%% We need to override `escalus` scram version, because 4.4 removes `fast_tls`, which is not
%% supported in master yet. When we can upgrade escalus, we can remove the explicit
%% `fast_scram` declaration from here.
{fast_scram, "0.7.0"},
{escalus, "4.4.1"},
{cowboy, "2.12.0"},
{csv, "3.0.3", {pkg, csve}},
{amqp_client, "4.0.3"},
Expand Down
12 changes: 6 additions & 6 deletions big_tests/rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
{<<"ct_groups_summary_hook">>,
{pkg,<<"ct_groups_summary_hook">>,<<"0.1.1">>},
0},
{<<"escalus">>,{pkg,<<"escalus">>,<<"4.3.0">>},0},
{<<"escalus">>,{pkg,<<"escalus">>,<<"4.4.1">>},0},
{<<"esip">>,{pkg,<<"esip">>,<<"1.0.56">>},0},
{<<"exml">>,{pkg,<<"hexml">>,<<"4.1.1">>},0},
{<<"fast_pbkdf2">>,{pkg,<<"fast_pbkdf2">>,<<"2.0.0">>},1},
{<<"fast_scram">>,{pkg,<<"fast_scram">>,<<"0.7.0">>},0},
{<<"fast_tls">>,{pkg,<<"fast_tls">>,<<"1.1.21">>},1},
{<<"fast_tls">>,{pkg,<<"fast_tls">>,<<"1.1.22">>},1},
{<<"fusco">>,{pkg,<<"fusco">>,<<"0.1.1">>},0},
{<<"gun">>,{pkg,<<"gun">>,<<"2.1.0">>},0},
{<<"jid">>,{pkg,<<"mongoose_jid">>,<<"2.2.0">>},0},
Expand All @@ -42,12 +42,12 @@
{<<"credentials_obfuscation">>, <<"34E18B126B3AEFD6E8143776FBE1CECEEA6792307C99AC5EE8687911F048CFD7">>},
{<<"csv">>, <<"69E7D9B3FDC72016644368762C6A3E6CBFEB85BCCADBF1BD99AB6C827E360E04">>},
{<<"ct_groups_summary_hook">>, <<"21B94902B6CF2D345F4D790D34B49654E71CB8E570DCCC9C1C3616DAE720A7AA">>},
{<<"escalus">>, <<"80301D57F4C863FA95F09AE148524508F18D7389B5070E2A5FFB7A38B51527C5">>},
{<<"escalus">>, <<"B32CC182F2246BA7B8B2853FF3A5A28F0F822540965053A7D3EF2894E0B17B5A">>},
{<<"esip">>, <<"63C0FDC667BE751714E1E5C14621A9334F21B60AC1BB68BE889454CA9CA021B7">>},
{<<"exml">>, <<"D46272177F3B779D75058005C744997034823AB3A237F9B30B56A583B063FDE3">>},
{<<"fast_pbkdf2">>, <<"72CDEE3C10C6B9B40E31194DE946A883CEEF6CF1F37D7FC9FD1A9D87502723F5">>},
{<<"fast_scram">>, <<"FAD4DD185E0DEFA34B0E30654AB0CC4048E9324BCF65BB261E0A86BF3C604F9F">>},
{<<"fast_tls">>, <<"65D7D547A09EEFB37A1C0D04D8601FAC4F3E6E2C1EDE859A7787081670F9648D">>},
{<<"fast_tls">>, <<"44356B256AFAD4399C2FC5059A3066669DAFD8BD4E4E796C9C1CF8910DDD265E">>},
{<<"fusco">>, <<"3DD6A90151DFEF30EA1937CC44E9A59177C0094918388D9BCAA2F2DC5E2AE4AA">>},
{<<"gun">>, <<"B4E4CBBF3026D21981C447E9E7CA856766046EFF693720BA43114D7F5DE36E87">>},
{<<"jid">>, <<"3761535829A0DBA5A6BBDF2EE6EA7BCD9A8F1ADA201EDB4D79E1E2B47D5FD3D6">>},
Expand All @@ -73,12 +73,12 @@
{<<"credentials_obfuscation">>, <<"738ACE0ED5545D2710D3F7383906FC6F6B582D019036E5269C4DBD85DBCED566">>},
{<<"csv">>, <<"741D1A55AABADAA3E0FE13051050101A73E90C4570B9F9403A939D9546813521">>},
{<<"ct_groups_summary_hook">>, <<"997CDE48FEB0C398989E4091A341D4FFF43CFA06CDB8FB2E80CC4A0E0362691C">>},
{<<"escalus">>, <<"8C4D39677D55C48B04EDE4EAC0FD0AD2A574BEDE7180761E6E3D3877900C7708">>},
{<<"escalus">>, <<"3389CF597E87F6C48314C4445B4B25A2678983B11C87A5C2308191A3BDA2F85A">>},
{<<"esip">>, <<"9EF3660CEF93B623F7368DCD5C79F4E704358631909E6DD464E335378815DA1F">>},
{<<"exml">>, <<"86C154396A9B21EEB0EDB9636D0E2D493FE0F59EAAF40FCFE795210F31119D8F">>},
{<<"fast_pbkdf2">>, <<"74159FD09FB8BF5E97D25137C6C83C28E2CF7E97D7C127D83310DFD0904BD732">>},
{<<"fast_scram">>, <<"39CB1D4C91C99E637E000A3864D274D8A9CB43D86EEC2495FE9546798DBFA015">>},
{<<"fast_tls">>, <<"131542913937025E48CD80AA81F00359686D5501B75621E72026A87B5229505B">>},
{<<"fast_tls">>, <<"E65779AEFB7AB15C4755230FEF8077E687D20CC5A3984A5974F9F657E8E2485B">>},
{<<"fusco">>, <<"6343551BD1E824F2A6CA85E1158C5B37C320FD449FBFEC7450A73F192AAF9022">>},
{<<"gun">>, <<"52FC7FC246BFC3B00E01AEA1C2854C70A366348574AB50C57DFE796D24A0101D">>},
{<<"jid">>, <<"0F2C69E4C142E21E7D87E6D70AC62ECF6EB00E97C86CF8CBF6BAD4B3BE8B0545">>},
Expand Down
14 changes: 7 additions & 7 deletions big_tests/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
{cowboy_port, 5280},
{cowboy_secure_port, 5285},
{http_api_client_endpoint_port, 8089},
{service_port, 8888},
{kicking_service_port, 8666},
{hidden_service_port, 8189},
{component_port, 8888},
{kicking_component_port, 8666},
{hidden_component_port, 8189},
{tls_component_port, 8190},
{gd_endpoint_port, 5555},
{http_notifications_port, 8000},
{blocks_hosts, [reg]}]},
Expand All @@ -48,7 +49,7 @@
{cluster, mim},
{c2s_tls_port, 5233},
{gd_endpoint_port, 6666},
{service_port, 8899}]},
{component_port, 8899}]},
{mim3, [{node, mongooseim3@localhost},
{domain, <<"localhost">>},
{host_type, <<"localhost">>},
Expand All @@ -69,7 +70,7 @@
{domain, <<"reg1">>},
{host_type, <<"red1">>},
{vars, "reg1"},
{service_port, 9990},
{component_port, 9990},
{c2s_port, 5252},
{gd_endpoint_port, 7777},
{gd_extra_endpoint_port, 10000},
Expand Down Expand Up @@ -210,8 +211,7 @@
{server, <<"localhost">>},
{host, <<"localhost">>},
{password, <<"scramshaplus">>},
{starttls, required},
{tls_module, fast_tls}
{starttls, required}
]},
{alice3, [ %% used in dynamic_domains_SUITE
{username, <<"alice">>},
Expand Down
19 changes: 4 additions & 15 deletions big_tests/tests/bosh_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ acks_test_cases() ->
%%--------------------------------------------------------------------

init_per_suite(Config) ->
instrument_helper:start(instrumentation_events(), negative_instrumentation_events()),
instrument_helper:start(instrumentation_events()),
Config1 = dynamic_modules:save_modules(host_type(), Config),
escalus:init_per_suite([{escalus_user_db, {module, escalus_ejabberd}} | Config1]).

Expand Down Expand Up @@ -195,9 +195,6 @@ create_and_terminate_session(Config) ->
[instrument_helper:assert(Event, Label, fun(#{byte_size := BS}) -> BS > 0 end)
|| {Event, Label} <- instrumentation_events(), Event =/= c2s_message_processed],

%% Verify C2S listener is not used
instrument_helper:assert_not_emitted(negative_instrumentation_events()),

%% Assert the session was terminated.
wait_for_zero_bosh_sessions().

Expand Down Expand Up @@ -952,14 +949,6 @@ wait_for_zero_bosh_sessions() ->

instrumentation_events() ->
instrument_helper:declared_events(mod_bosh, [])
++ instrument_helper:declared_events(mongoose_c2s, [global])
++ [{c2s_message_processed, #{host_type => host_type()}}].

negative_instrumentation_events() ->
[{Name, #{}} || Name <- negative_instrumentation_events_names()].

negative_instrumentation_events_names() ->
[c2s_tcp_data_out,
c2s_tcp_data_in,
c2s_tls_data_out,
c2s_tls_data_in].
++ [{c2s_message_processed, #{host_type => domain_helper:host_type()}},
{xmpp_element_size_out, #{connection_type => c2s}, #{metrics => #{byte_size => histogram}}},
{xmpp_element_size_in, #{connection_type => c2s}, #{metrics => #{byte_size => histogram}}}].
38 changes: 30 additions & 8 deletions big_tests/tests/ca_certificate_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ generate_cert(Config, #{cn := User} = CertSpec, BasicTemplateValues) ->
ct:log("OpenSSL config: ~ts~n~ts", [UserConfig, OpenSSLConfig]),
file:write_file(UserConfig, OpenSSLConfig),
UserKey = filename:join(?config(priv_dir, Config), User ++ "_key.pem"),
MaybeCritical = maps:get(with_critical_extension, CertSpec, false),
case maps:get(signed, CertSpec, ca) of
ca -> generate_ca_signed_cert(Config, User, UserConfig, UserKey);
self -> generate_self_signed_cert(Config, User, UserConfig, UserKey)
ca ->
generate_ca_signed_cert(Config, User, UserConfig, UserKey, MaybeCritical);
self ->
generate_self_signed_cert(Config, User, UserConfig, UserKey, MaybeCritical)
end.

prepare_template_values(User, XMPPAddrsIn) ->
Expand All @@ -35,11 +38,12 @@ make_xmpp_addr_entry(I, Addr) ->
"otherName." ++ integer_to_list(I) ++ " = id-on-xmppAddr;UTF8:" ++ Addr.


generate_ca_signed_cert(Config, Filename, ConfigCfg, KeyFilename) ->
generate_ca_signed_cert(Config, Filename, ConfigCfg, KeyFilename, MaybeCritical) ->
Csr = filename:join(?config(priv_dir, Config), Filename ++ ".csr"),
Cmd = ["openssl req -config ", ConfigCfg, " -newkey rsa:2048 -sha256 -nodes -out ",
Csr, " -keyout ", KeyFilename, " -outform PEM"],
Out = os:cmd(Cmd),
Csr, " -keyout ", KeyFilename, " -outform PEM" | extensions(ca_signed, MaybeCritical)],
Out = os:cmd(Cmd ++ " && echo CREATED"),
verify_created(Cmd, Out),
ct:log("generate_ca_signed_cert 1:~nCmd ~p~nOut ~ts", [Cmd, Out]),
Cert = filename:join(?config(priv_dir, Config), Filename ++ "_cert.pem"),
SignCmd = filename:join(?config(mim_data_dir, Config), "sign_cert.sh"),
Expand All @@ -50,11 +54,29 @@ generate_ca_signed_cert(Config, Filename, ConfigCfg, KeyFilename) ->
#{key => KeyFilename,
cert => Cert}.

generate_self_signed_cert(Config, Filename, ConfigCfg, KeyFilename) ->
generate_self_signed_cert(Config, Filename, ConfigCfg, KeyFilename, MaybeCritical) ->
Cert = filename:join(?config(priv_dir, Config), Filename ++ "_self_signed_cert.pem"),
Cmd = ["openssl req -config ", ConfigCfg, " -newkey rsa:2048 -sha256 -nodes -out ",
Cert, " -keyout ", KeyFilename, " -x509 -outform PEM -extensions client_req_extensions"],
OutLog = os:cmd(Cmd),
Cert, " -keyout ", KeyFilename, " -x509 -outform PEM", extensions(self_signed, MaybeCritical)],
OutLog = os:cmd(Cmd ++ " && echo CREATED"),
verify_created(Cmd, OutLog),
ct:log("generate_self_signed_cert:~nCmd ~p~nOut ~ts", [Cmd, OutLog]),
#{key => KeyFilename,
cert => Cert}.

verify_created(Cmd, Output) ->
case lists:suffix("CREATED\n", Output) of
true ->
ok;
false ->
ct:fail({failed_to_create_certificate, Cmd, Output})
end.

extensions(ca_signed, false) ->
[];
extensions(ca_signed, true) ->
" -extensions critical_extensions";
extensions(self_signed, false) ->
" -extensions client_req_extensions";
extensions(self_signed, true) ->
" -extensions self_signed_critical_extensions".
Loading