Suggested by Michael Harbler on the mailing list
Signed-off-by: Andy Green <andy.green@linaro.org>
or capabliity flag information, for the case multiple versions of a protocol are
supported.
+int lws_is_ssl(wsi) added to allow user code to know if the connection was made
+over ssl or not. If LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT is used, both
+ssl and non-ssl connections are possible and may need to be treated differently
+in the user code.
+
v1.3-chrome37-firefox30
=======================
if (log_emit_function)
lwsl_emit = log_emit_function;
}
+
+/**
+ * lws_use_ssl() - Find out if connection is using SSL
+ * @wsi: websocket connection to check
+ *
+ * Returns 0 if the connection is not using SSL, 1 if using SSL and
+ * using verified cert, and 2 if using SSL but the cert was not
+ * checked (appears for client wsi told to skip check on connection)
+ */
+LWS_VISIBLE int
+lws_is_ssl(struct libwebsocket *wsi)
+{
+ return wsi->use_ssl;
+}
LWS_VISIBLE LWS_EXTERN int
lws_frame_is_binary(struct libwebsocket *wsi);
+LWS_VISIBLE LWS_EXTERN int
+lws_is_ssl(struct libwebsocket *wsi);
+
LWS_VISIBLE LWS_EXTERN unsigned char *
libwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md);