From b826f968cb51e7b503f8d40ff686399adaff1dd1 Mon Sep 17 00:00:00 2001 From: maxmcd Date: Wed, 6 Jun 2018 12:51:15 -0400 Subject: [PATCH] Add --disable-ssl flag to webrtc-sendrecv.c --- webrtc/sendrecv/gst/Dockerfile | 10 ++++------ webrtc/sendrecv/gst/webrtc-sendrecv.c | 9 +++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/webrtc/sendrecv/gst/Dockerfile b/webrtc/sendrecv/gst/Dockerfile index 2396759ff2..57931a771d 100644 --- a/webrtc/sendrecv/gst/Dockerfile +++ b/webrtc/sendrecv/gst/Dockerfile @@ -7,14 +7,12 @@ RUN apt-get install -y libjson-glib-dev WORKDIR /opt/ COPY . /opt/ -RUN sed -i 's/wss:\/\/webrtc.nirbheek.in:8443/ws:\/\/signalling:8443/g' \ - /opt/webrtc-sendrecv.c -RUN sed -i 's/strict_ssl = TRUE/strict_ssl = FALSE/g' \ - /opt/webrtc-sendrecv.c - RUN make CMD echo "Waiting a few seconds for you to open the browser at localhost:8080" \ && sleep 10 \ - && ./webrtc-sendrecv --peer-id=1 + && ./webrtc-sendrecv \ + --peer-id=1 \ + --server=ws://signalling:8443 \ + --disable-ssl diff --git a/webrtc/sendrecv/gst/webrtc-sendrecv.c b/webrtc/sendrecv/gst/webrtc-sendrecv.c index 7053a61b6a..109b14d248 100644 --- a/webrtc/sendrecv/gst/webrtc-sendrecv.c +++ b/webrtc/sendrecv/gst/webrtc-sendrecv.c @@ -45,12 +45,13 @@ static SoupWebsocketConnection *ws_conn = NULL; static enum AppState app_state = 0; static const gchar *peer_id = NULL; static const gchar *server_url = "wss://webrtc.nirbheek.in:8443"; -static gboolean strict_ssl = TRUE; +static gboolean disable_ssl = FALSE; static GOptionEntry entries[] = { { "peer-id", 0, 0, G_OPTION_ARG_STRING, &peer_id, "String ID of the peer to connect to", "ID" }, { "server", 0, 0, G_OPTION_ARG_STRING, &server_url, "Signalling server to connect to", "URL" }, + { "disable-ssl", 0, 0, G_OPTION_ARG_NONE, &disable_ssl, "Disable ssl", NULL }, { NULL }, }; @@ -569,7 +570,7 @@ connect_to_websocket_server_async (void) SoupSession *session; const char *https_aliases[] = {"wss", NULL}; - session = soup_session_new_with_options (SOUP_SESSION_SSL_STRICT, strict_ssl, + session = soup_session_new_with_options (SOUP_SESSION_SSL_STRICT, !disable_ssl, SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE, //SOUP_SESSION_SSL_CA_FILE, "/etc/ssl/certs/ca-bundle.crt", SOUP_SESSION_HTTPS_ALIASES, https_aliases, NULL); @@ -634,13 +635,13 @@ main (int argc, char *argv[]) return -1; } - /* Don't use strict ssl when running a localhost server, because + /* Disable ssl when running a localhost server, because * it's probably a test server with a self-signed certificate */ { GstUri *uri = gst_uri_from_string (server_url); if (g_strcmp0 ("localhost", gst_uri_get_host (uri)) == 0 || g_strcmp0 ("127.0.0.1", gst_uri_get_host (uri)) == 0) - strict_ssl = FALSE; + disable_ssl = TRUE; gst_uri_unref (uri); }