add callbacks for debug messages
[project/ustream-ssl.git] / ustream-openssl.h
index 0a6ca91023d0f9b13fb8878610e56a5dbd4fecbc..f547aa663f98f6f93602d47b12ede05f0cc790a6 100644 (file)
 
 #if defined(HAVE_WOLFSSL)
 #include <wolfssl/options.h>
-#endif
-
+#include <wolfssl/openssl/ssl.h>
+#else
 #include <openssl/ssl.h>
 #include <openssl/err.h>
+#endif
+
 #include <stdbool.h>
 
+struct ustream_ssl_ctx {
+       SSL_CTX *ssl;
+       BIO *debug_bio;
+       ustream_ssl_debug_cb debug_cb;
+       void *debug_cb_priv;
+};
+
 void __ustream_ssl_session_free(void *ssl);
 
-static inline void *__ustream_ssl_session_new(void *ctx)
+struct bio_ctx {
+       BIO_METHOD *meth;
+       struct ustream *stream;
+};
+
+static inline void *__ustream_ssl_session_new(struct ustream_ssl_ctx *ctx)
 {
-       return SSL_new(ctx);
+       return SSL_new(ctx->ssl);
 }
 
 static inline char *__ustream_ssl_strerror(int error, char *buffer, int len)