define server_cert in strongswan.conf
This commit is contained in:
@@ -529,7 +529,8 @@ METHOD(tnc_ifmap_soap_t, destroy, void,
|
|||||||
|
|
||||||
static bool axis2c_init(private_tnc_ifmap_soap_t *this)
|
static bool axis2c_init(private_tnc_ifmap_soap_t *this)
|
||||||
{
|
{
|
||||||
axis2_char_t *server, *client_home, *username, *password, *auth_type;
|
axis2_char_t *server, *server_cert, *client_home;
|
||||||
|
axis2_char_t *username, *password, *auth_type;
|
||||||
axis2_endpoint_ref_t* endpoint_ref = NULL;
|
axis2_endpoint_ref_t* endpoint_ref = NULL;
|
||||||
axis2_options_t *options = NULL;
|
axis2_options_t *options = NULL;
|
||||||
axis2_transport_in_desc_t *transport_in;
|
axis2_transport_in_desc_t *transport_in;
|
||||||
@@ -537,11 +538,14 @@ static bool axis2c_init(private_tnc_ifmap_soap_t *this)
|
|||||||
axis2_transport_sender_t *transport_sender;
|
axis2_transport_sender_t *transport_sender;
|
||||||
axutil_property_t* property;
|
axutil_property_t* property;
|
||||||
|
|
||||||
|
/* Getting configuration parameters from strongswan.conf */
|
||||||
client_home = lib->settings->get_str(lib->settings,
|
client_home = lib->settings->get_str(lib->settings,
|
||||||
"charon.plugins.tnc-ifmap.client_home",
|
"charon.plugins.tnc-ifmap.client_home",
|
||||||
AXIS2_GETENV("AXIS2C_HOME"));
|
AXIS2_GETENV("AXIS2C_HOME"));
|
||||||
server = lib->settings->get_str(lib->settings,
|
server = lib->settings->get_str(lib->settings,
|
||||||
"charon.plugins.tnc-ifmap.server", IFMAP_SERVER);
|
"charon.plugins.tnc-ifmap.server", IFMAP_SERVER);
|
||||||
|
server_cert = lib->settings->get_str(lib->settings,
|
||||||
|
"charon.plugins.tnc-ifmap.server_cert", NULL);
|
||||||
auth_type = lib->settings->get_str(lib->settings,
|
auth_type = lib->settings->get_str(lib->settings,
|
||||||
"charon.plugins.tnc-ifmap.auth_type", "Basic");
|
"charon.plugins.tnc-ifmap.auth_type", "Basic");
|
||||||
username = lib->settings->get_str(lib->settings,
|
username = lib->settings->get_str(lib->settings,
|
||||||
@@ -549,6 +553,11 @@ static bool axis2c_init(private_tnc_ifmap_soap_t *this)
|
|||||||
password = lib->settings->get_str(lib->settings,
|
password = lib->settings->get_str(lib->settings,
|
||||||
"charon.plugins.tnc-ifmap.password", NULL);
|
"charon.plugins.tnc-ifmap.password", NULL);
|
||||||
|
|
||||||
|
if (!server_cert)
|
||||||
|
{
|
||||||
|
DBG1(DBG_TNC, "MAP server certificate not defined");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
if (!username || !password)
|
if (!username || !password)
|
||||||
{
|
{
|
||||||
DBG1(DBG_TNC, "MAP client %s%s%s not defined",
|
DBG1(DBG_TNC, "MAP client %s%s%s not defined",
|
||||||
@@ -563,15 +572,18 @@ static bool axis2c_init(private_tnc_ifmap_soap_t *this)
|
|||||||
options = axis2_options_create(this->env);
|
options = axis2_options_create(this->env);
|
||||||
|
|
||||||
/* Path to the MAP server certificate */
|
/* Path to the MAP server certificate */
|
||||||
property =axutil_property_create_with_args(this->env,
|
property =axutil_property_create_with_args(this->env, 0, 0, 0, server_cert);
|
||||||
0, 0, 0, "/home/andi/axis2c/irond.pem");
|
axis2_options_set_property(options, this->env, AXIS2_SSL_SERVER_CERT, property);
|
||||||
|
|
||||||
/* Define the MAP server as the to endpoint reference */
|
/* Define the MAP server as the to endpoint reference */
|
||||||
endpoint_ref = axis2_endpoint_ref_create(this->env, server);
|
endpoint_ref = axis2_endpoint_ref_create(this->env, server);
|
||||||
|
axis2_options_set_to(options, this->env, endpoint_ref);
|
||||||
|
|
||||||
/* Set up https transport */
|
/* Set up HTTP Basic or Digest MAP client authentication */
|
||||||
axis2_options_set_http_auth_info(options, this->env, username, password,
|
axis2_options_set_http_auth_info(options, this->env, username, password,
|
||||||
auth_type);
|
auth_type);
|
||||||
|
|
||||||
|
/* Set up https transport */
|
||||||
transport_in = axis2_transport_in_desc_create(this->env,
|
transport_in = axis2_transport_in_desc_create(this->env,
|
||||||
AXIS2_TRANSPORT_ENUM_HTTPS);
|
AXIS2_TRANSPORT_ENUM_HTTPS);
|
||||||
transport_out = axis2_transport_out_desc_create(this->env,
|
transport_out = axis2_transport_out_desc_create(this->env,
|
||||||
@@ -581,8 +593,6 @@ static bool axis2c_init(private_tnc_ifmap_soap_t *this)
|
|||||||
transport_sender);
|
transport_sender);
|
||||||
axis2_options_set_transport_in(options, this->env, transport_in);
|
axis2_options_set_transport_in(options, this->env, transport_in);
|
||||||
axis2_options_set_transport_out(options, this->env, transport_out);
|
axis2_options_set_transport_out(options, this->env, transport_out);
|
||||||
axis2_options_set_to(options, this->env, endpoint_ref);
|
|
||||||
axis2_options_set_property(options, this->env, AXIS2_SSL_SERVER_CERT, property);
|
|
||||||
|
|
||||||
/* Create the axis2 service client */
|
/* Create the axis2 service client */
|
||||||
this->svc_client = axis2_svc_client_create(this->env, client_home);
|
this->svc_client = axis2_svc_client_create(this->env, client_home);
|
||||||
|
|||||||
Reference in New Issue
Block a user