Commit 115933e6 authored by Ghislain MARY's avatar Ghislain MARY

Fix some TLS unit tests on Windows Phone 8 by giving a root ca file.

parent a55f23f7
......@@ -64,6 +64,7 @@ void BelleSipTesterNative::run(Platform::String^ suiteName, Platform::String^ ca
belle_sip_set_log_handler(belleSipNativeOutputTraceHandler);
CU_set_trace_handler(nativeOutputTraceHandler);
belle_sip_tester_set_root_ca_path("Assets/rootca.pem");
belle_sip_tester_run_tests(wssuitename == all ? 0 : csuitename, wscasename == all ? 0 : ccasename);
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -129,6 +129,9 @@
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\rootca.pem">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Properties\AppManifest.xml" />
<None Include="Properties\WMAppManifest.xml">
<SubType>Designer</SubType>
......
......@@ -22,8 +22,6 @@
#include "belle_sip_tester.h"
#include <belle_sip_internal.h>
extern const char *root_ca_path;
typedef struct http_counters{
int response_headers_count;
int response_count;
......@@ -83,9 +81,9 @@ 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) {
if (belle_sip_tester_get_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_tls_verify_policy_set_root_ca(policy,belle_sip_tester_get_root_ca_path());
belle_http_provider_set_tls_verify_policy(prov,policy);
}
return 0;
......
......@@ -193,6 +193,7 @@ int register_init(void) {
if (lp) {
/* since test.linphone.org does not have proper certificates, don't verify anything*/
belle_sip_tls_listening_point_set_verify_exceptions(BELLE_SIP_TLS_LISTENING_POINT(lp),BELLE_SIP_TLS_LISTENING_POINT_BADCERT_ANY_REASON);
belle_sip_tls_listening_point_set_root_ca(BELLE_SIP_TLS_LISTENING_POINT(lp), belle_sip_tester_get_root_ca_path());
belle_sip_provider_add_listening_point(prov,lp);
}
......
......@@ -29,8 +29,8 @@
extern const char *test_domain;
extern const char *auth_domain;
const char *root_ca_path = NULL;
static const char *belle_sip_tester_root_ca_path = NULL;
static test_suite_t **test_suite = NULL;
static int nb_test_suites = 0;
......@@ -123,7 +123,7 @@ int belle_sip_tester_ipv6_available(void){
return ipv6_available;
}
void belle_sip_tester_init(void) {
void belle_sip_tester_init(const char *root_ca_path) {
belle_sip_object_enable_marshal_check(TRUE);
ipv6_available=_belle_sip_tester_ipv6_available();
add_test_suite(&cast_test_suite);
......@@ -141,6 +141,14 @@ void belle_sip_tester_init(void) {
add_test_suite(&http_test_suite);
}
const char * belle_sip_tester_get_root_ca_path(void) {
return belle_sip_tester_root_ca_path;
}
void belle_sip_tester_set_root_ca_path(const char *root_ca_path) {
belle_sip_tester_root_ca_path = root_ca_path;
}
void belle_sip_tester_uninit(void) {
......@@ -233,6 +241,7 @@ void helper(const char *name) {
int main (int argc, char *argv[]) {
int i;
int ret;
const char *root_ca_path = NULL;
const char *suite_name=NULL;
const char *test_name=NULL;
const char *env_domain=getenv("TEST_DOMAIN");
......@@ -294,6 +303,7 @@ int main (int argc, char *argv[]) {
}
}
belle_sip_tester_set_root_ca_path(root_ca_path);
ret = belle_sip_tester_run_tests(suite_name, test_name);
belle_sip_tester_uninit();
return ret;
......
......@@ -65,6 +65,8 @@ extern const char * belle_sip_tester_test_suite_name(int suite_index);
extern const char * belle_sip_tester_test_name(const char *suite_name, int test_index);
extern void belle_sip_tester_init(void);
extern void belle_sip_tester_uninit(void);
extern const char * belle_sip_tester_get_root_ca_path(void);
extern void belle_sip_tester_set_root_ca_path(const char *root_ca_path);
extern int belle_sip_tester_run_tests(const char *suite_name, const char *test_name);
extern const char* belle_sip_tester_client_cert;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment