summaryrefslogtreecommitdiff
path: root/src/ssl_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssl_new.c')
-rw-r--r--src/ssl_new.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ssl_new.c b/src/ssl_new.c
new file mode 100644
index 0000000..4833778
--- /dev/null
+++ b/src/ssl_new.c
@@ -0,0 +1,16 @@
+#include "ucspissl.h"
+#include "ndelay.h"
+
+SSL *ssl_new(SSL_CTX *ctx,int s)
+{
+ BIO *sbio;
+ SSL *ssl;
+
+ ssl = SSL_new(ctx);
+ if (!ssl) return 0;
+ sbio = BIO_new_socket(s,BIO_NOCLOSE);
+ if (!sbio) return 0;
+ SSL_set_bio(ssl,sbio,sbio);
+ return ssl;
+}
+