Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
0e3223ed
Commit
0e3223ed
authored
Feb 13, 2014
by
Ghislain MARY
Browse files
Add option to specify a root ca file to load in the tester.
parent
608d4395
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
tester/belle_http_tester.c
tester/belle_http_tester.c
+7
-0
tester/belle_sip_tester.c
tester/belle_sip_tester.c
+7
-5
No files found.
tester/belle_http_tester.c
View file @
0e3223ed
...
...
@@ -22,6 +22,8 @@
#include "belle_sip_tester.h"
#include <belle_sip_internal.h>
extern
const
char
*
root_ca_path
;
typedef
struct
http_counters
{
int
response_count
;
int
io_error_count
;
...
...
@@ -80,6 +82,11 @@ static belle_http_provider_t *prov=NULL;
static
int
http_init
(
void
){
stack
=
belle_sip_stack_new
(
NULL
);
prov
=
belle_sip_stack_create_http_provider
(
stack
,
"0.0.0.0"
);
if
(
root_ca_path
!=
NULL
)
{
belle_tls_verify_policy_t
*
policy
=
belle_tls_verify_policy_new
();
belle_tls_verify_policy_set_root_ca
(
policy
,
root_ca_path
);
belle_http_provider_set_tls_verify_policy
(
prov
,
policy
);
}
return
0
;
}
...
...
tester/belle_sip_tester.c
View file @
0e3223ed
...
...
@@ -29,7 +29,7 @@
extern
const
char
*
test_domain
;
extern
const
char
*
auth_domain
;
const
char
*
root_ca_path
=
NULL
;
static
test_suite_t
**
test_suite
=
NULL
;
static
int
nb_test_suites
=
0
;
...
...
@@ -210,6 +210,7 @@ void helper(const char *name) {
"
\t\t\t
--verbose
\n
"
"
\t\t\t
--domain <test sip domain>
\n
"
"
\t\t\t
--auth-domain <test auth domain>
\n
"
"
\t\t\t
--root-ca <root ca file path>
\n
"
#ifdef HAVE_CU_GET_SUITE
"
\t\t\t
--list-suites
\n
"
"
\t\t\t
--list-tests <suite>
\n
"
...
...
@@ -250,10 +251,12 @@ int main (int argc, char *argv[]) {
}
else
if
(
strcmp
(
argv
[
i
],
"--domain"
)
==
0
){
CHECK_ARG
(
"--domain"
,
++
i
,
argc
);
test_domain
=
argv
[
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"--auth-domain"
)
==
0
){
}
else
if
(
strcmp
(
argv
[
i
],
"--auth-domain"
)
==
0
){
CHECK_ARG
(
"--auth-domain"
,
++
i
,
argc
);
auth_domain
=
argv
[
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"--root-ca"
)
==
0
)
{
CHECK_ARG
(
"--root-ca"
,
++
i
,
argc
);
root_ca_path
=
argv
[
i
];
}
#ifdef HAVE_CU_GET_SUITE
else
if
(
strcmp
(
argv
[
i
],
"--list-suites"
)
==
0
){
...
...
@@ -272,8 +275,7 @@ int main (int argc, char *argv[]) {
fprintf
(
stdout
,
"%s
\n
"
,
test_name
);
}
return
0
;
}
else
if
(
strcmp
(
argv
[
i
],
"--test"
)
==
0
){
}
else
if
(
strcmp
(
argv
[
i
],
"--test"
)
==
0
){
CHECK_ARG
(
"--test"
,
++
i
,
argc
);
test_name
=
argv
[
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"--suite"
)
==
0
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment