summaryrefslogtreecommitdiff
path: root/src/ssl_cca.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssl_cca.c')
-rw-r--r--src/ssl_cca.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ssl_cca.c b/src/ssl_cca.c
new file mode 100644
index 0000000..112a9f1
--- /dev/null
+++ b/src/ssl_cca.c
@@ -0,0 +1,18 @@
+#include "ucspissl.h"
+
+int ssl_cca(SSL_CTX *ctx,const char *certfile)
+{
+ STACK_OF(X509_NAME) *x;
+
+ if (!certfile) return 1;
+
+ x = SSL_load_client_CA_file(certfile);
+ if (!x) return 0;
+
+ SSL_CTX_set_client_CA_list(ctx,x);
+
+ SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,0);
+
+ return 1;
+}
+