summaryrefslogtreecommitdiff
path: root/src/ssl_cca.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-14 21:28:19 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-14 21:28:19 +0200
commit1087d4df2a7342d2832ba3bab1843bf4a3040775 (patch)
tree96cd6ea198cc542f29c0660d5e5f7083af84d711 /src/ssl_cca.c
add version 0.12.10HEADmaster
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;
+}
+