ssl expose public wsi->ssl getter
authorDenis Osvald <denis.osvald@sartura.hr>
Mon, 23 Jan 2017 11:34:46 +0000 (19:34 +0800)
committerAndy Green <andy@warmcat.com>
Mon, 23 Jan 2017 11:34:46 +0000 (19:34 +0800)
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
lib/libwebsockets.c
lib/libwebsockets.h

index d081075..b0b0556 100755 (executable)
@@ -1248,6 +1248,14 @@ lws_is_ssl(struct lws *wsi)
 #endif
 }
 
+#ifdef LWS_OPENSSL_SUPPORT
+LWS_VISIBLE SSL*
+lws_get_ssl(struct lws *wsi)
+{
+       return wsi->ssl;
+}
+#endif
+
 LWS_VISIBLE int
 lws_partial_buffered(struct lws *wsi)
 {
index 5c102f8..410ef7b 100644 (file)
@@ -3979,6 +3979,17 @@ lws_is_ssl(struct lws *wsi);
  */
 LWS_VISIBLE LWS_EXTERN int
 lws_is_cgi(struct lws *wsi);
+
+#ifdef LWS_OPENSSL_SUPPORT
+/**
+ * lws_get_ssl() - Return wsi's SSL context structure
+ * \param wsi: websocket connection
+ *
+ * Returns pointer to the SSL library's context structure
+ */
+LWS_VISIBLE LWS_EXTERN SSL*
+lws_get_ssl(struct lws *wsi);
+#endif
 ///@}