summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/uhttpd/src/uhttpd-tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/package/uhttpd/src/uhttpd-tls.c')
-rw-r--r--contrib/package/uhttpd/src/uhttpd-tls.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/package/uhttpd/src/uhttpd-tls.c b/contrib/package/uhttpd/src/uhttpd-tls.c
index bbec7509df..cb50616380 100644
--- a/contrib/package/uhttpd/src/uhttpd-tls.c
+++ b/contrib/package/uhttpd/src/uhttpd-tls.c
@@ -33,6 +33,16 @@ SSL_CTX * uh_tls_ctx_init()
return c;
}
+int uh_tls_ctx_cert(SSL_CTX *c, const char *file)
+{
+ return SSL_CTX_use_certificate_file(c, file, SSL_FILETYPE_ASN1);
+}
+
+int uh_tls_ctx_key(SSL_CTX *c, const char *file)
+{
+ return SSL_CTX_use_PrivateKey_file(c, file, SSL_FILETYPE_ASN1);
+}
+
void uh_tls_ctx_free(struct listener *l)
{
SSL_CTX_free(l->tls);
@@ -48,6 +58,16 @@ void uh_tls_client_accept(struct client *c)
}
}
+int uh_tls_client_recv(struct client *c, void *buf, int len)
+{
+ return SSL_read(c->tls, buf, len);
+}
+
+int uh_tls_client_send(struct client *c, void *buf, int len)
+{
+ return SSL_write(c->tls, buf, len);
+}
+
void uh_tls_client_close(struct client *c)
{
if( c->tls )
@@ -58,3 +78,5 @@ void uh_tls_client_close(struct client *c)
c->tls = NULL;
}
}
+
+