Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 0a7aaf6

Browse files
maxmcdsdroege
authored andcommitted
Add --disable-ssl flag to webrtc-sendrecv.c
1 parent a0a9487 commit 0a7aaf6

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

sendrecv/gst/Dockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ RUN apt-get install -y libjson-glib-dev
77
WORKDIR /opt/
88
COPY . /opt/
99

10-
RUN sed -i 's/wss:\/\/webrtc.nirbheek.in:8443/ws:\/\/signalling:8443/g' \
11-
/opt/webrtc-sendrecv.c
12-
RUN sed -i 's/strict_ssl = TRUE/strict_ssl = FALSE/g' \
13-
/opt/webrtc-sendrecv.c
14-
1510
RUN make
1611

1712
CMD echo "Waiting a few seconds for you to open the browser at localhost:8080" \
1813
&& sleep 10 \
19-
&& ./webrtc-sendrecv --peer-id=1
14+
&& ./webrtc-sendrecv \
15+
--peer-id=1 \
16+
--server=ws://signalling:8443 \
17+
--disable-ssl
2018

sendrecv/gst/webrtc-sendrecv.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ static SoupWebsocketConnection *ws_conn = NULL;
4545
static enum AppState app_state = 0;
4646
static const gchar *peer_id = NULL;
4747
static const gchar *server_url = "wss://webrtc.nirbheek.in:8443";
48-
static gboolean strict_ssl = TRUE;
48+
static gboolean disable_ssl = FALSE;
4949

5050
static GOptionEntry entries[] =
5151
{
5252
{ "peer-id", 0, 0, G_OPTION_ARG_STRING, &peer_id, "String ID of the peer to connect to", "ID" },
5353
{ "server", 0, 0, G_OPTION_ARG_STRING, &server_url, "Signalling server to connect to", "URL" },
54+
{ "disable-ssl", 0, 0, G_OPTION_ARG_NONE, &disable_ssl, "Disable ssl", NULL },
5455
{ NULL },
5556
};
5657

@@ -569,7 +570,7 @@ connect_to_websocket_server_async (void)
569570
SoupSession *session;
570571
const char *https_aliases[] = {"wss", NULL};
571572

572-
session = soup_session_new_with_options (SOUP_SESSION_SSL_STRICT, strict_ssl,
573+
session = soup_session_new_with_options (SOUP_SESSION_SSL_STRICT, !disable_ssl,
573574
SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE,
574575
//SOUP_SESSION_SSL_CA_FILE, "/etc/ssl/certs/ca-bundle.crt",
575576
SOUP_SESSION_HTTPS_ALIASES, https_aliases, NULL);
@@ -634,13 +635,13 @@ main (int argc, char *argv[])
634635
return -1;
635636
}
636637

637-
/* Don't use strict ssl when running a localhost server, because
638+
/* Disable ssl when running a localhost server, because
638639
* it's probably a test server with a self-signed certificate */
639640
{
640641
GstUri *uri = gst_uri_from_string (server_url);
641642
if (g_strcmp0 ("localhost", gst_uri_get_host (uri)) == 0 ||
642643
g_strcmp0 ("127.0.0.1", gst_uri_get_host (uri)) == 0)
643-
strict_ssl = FALSE;
644+
disable_ssl = TRUE;
644645
gst_uri_unref (uri);
645646
}
646647

0 commit comments

Comments
 (0)