[Spice-devel] [PATCH spice-server] replay: Support TLS in replay utility

Christophe Fergeau cfergeau at redhat.com
Mon Feb 6 09:00:41 UTC 2017


On Fri, Feb 03, 2017 at 03:14:32PM +0000, Frediano Ziglio wrote:
> Allows to test encrypted connections.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/tests/replay.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/server/tests/replay.c b/server/tests/replay.c
> index 9757e59..d76ef00 100644
> --- a/server/tests/replay.c
> +++ b/server/tests/replay.c
> @@ -325,6 +325,9 @@ int main(int argc, char **argv)
>      gint port = 5000, compression = SPICE_IMAGE_COMPRESSION_AUTO_GLZ;
>      gint streaming = SPICE_STREAM_VIDEO_FILTER;
>      gboolean wait = FALSE;
> +    gint tls_port = 0;
> +    gchar *cacert_file = NULL, *cert_file = NULL, *key_file = NULL;
> +
>      FILE *fd;
>  
>      GOptionEntry entries[] = {
> @@ -337,6 +340,10 @@ int main(int argc, char **argv)
>          { "slow", 's', 0, G_OPTION_ARG_INT, &slow, "Slow down replay. Delays USEC microseconds before each command", "USEC" },
>          { "skip", 0, 0, G_OPTION_ARG_INT, &skip, "Skip 'slow' for the first n commands", NULL },
>          { "count", 0, 0, G_OPTION_ARG_NONE, &print_count, "Print the number of commands processed", NULL },
> +        { "tls-port", 0, 0, G_OPTION_ARG_INT, &tls_port, "Secure server port", "PORT" },
> +        { "cacert-file", 0, 0, G_OPTION_ARG_FILENAME, &cacert_file, "TLS CA certificate", "FILE" },
> +        { "cert-file", 0, 0, G_OPTION_ARG_FILENAME, &cert_file, "TLS server certificate", "FILE" },
> +        { "key-file", 0, 0, G_OPTION_ARG_FILENAME, &key_file, "TLS server private key", "FILE" },
>          { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file, "replay file", "FILE" },

You need to free these G_OPTION_ARG_FILENAME options when you no longer
need them.

Apart from this,
Acked-by: Christophe Fergeau <cfergeau at redhat.com>

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170206/d1f9f413/attachment.sig>


More information about the Spice-devel mailing list