diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2012-06-30 20:18:34 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2012-06-30 20:18:34 +0000 |
| commit | 21124ba5a7d75ebb9856233b37e09476b4872280 (patch) | |
| tree | 66769b255a9b95b6c7d53c528648046d80905ffa | |
| parent | 965cecefa6156cee570acf81babda3d128f5f1b1 (diff) | |
| download | pica-pica-21124ba5a7d75ebb9856233b37e09476b4872280.tar.gz pica-pica-21124ba5a7d75ebb9856233b37e09476b4872280.zip | |
certificate verificationperformed by node; new option CA_cert_file in config file
git-svn-id: svn://localhost/project_picapica/trunk@135 fb96df88-216d-11de-830c-f3023f12d8ac
| -rwxr-xr-x | PICA_node.c | 8 | ||||
| -rw-r--r-- | PICA_nodeconfig.c | 1 | ||||
| -rw-r--r-- | PICA_nodeconfig.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/PICA_node.c b/PICA_node.c index ae23bac..2bcc705 100755 --- a/PICA_node.c +++ b/PICA_node.c @@ -1035,6 +1035,7 @@ switch(ccl->state) int PICA_node_init() { struct sockaddr_in sd; +int ret; SSL_load_error_strings(); SSL_library_init(); @@ -1083,6 +1084,13 @@ ctx=SSL_CTX_new(TLSv1_method()); if (!ctx) ;//ERR_CHECK + +ret = SSL_CTX_load_verify_locations(ctx, nodecfg.CA_cert_file, 0); + +;//ERR_CHECK + +SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL); + return 1; } diff --git a/PICA_nodeconfig.c b/PICA_nodeconfig.c index edf3710..f495962 100644 --- a/PICA_nodeconfig.c +++ b/PICA_nodeconfig.c @@ -20,6 +20,7 @@ if (!d) nodecfg.announced_addr = strdup(iniparser_getstring(d, "pica-node:announced_addr", NULL)); nodecfg.listen_port = strdup(iniparser_getstring(d, "pica-node:listen_port", NULL)); nodecfg.nodes_db_file = strdup(iniparser_getstring(d, "pica-node:nodes_db_file", NULL)); +nodecfg.CA_cert_file = strdup(iniparser_getstring(d, "pica-node:CA_cert_file", NULL)); iniparser_freedict(d); diff --git a/PICA_nodeconfig.h b/PICA_nodeconfig.h index 34ce736..db44346 100644 --- a/PICA_nodeconfig.h +++ b/PICA_nodeconfig.h @@ -8,6 +8,7 @@ char *announced_addr; char *listen_port; char *nodes_db_file; char *config_file; +char *CA_cert_file; }; extern struct nodeconfig nodecfg; |
