File tls.patch of Package wsmancli.38376

commit ab8eba36e2ea108ebf4c4942da6d1703706849f4
Author: Klaus Kämpf <kkaempf@gmail.com>
Date:   Mon Mar 3 19:58:48 2025 +0100

    Add flag to enfore https transport scheme
    
    https could only be choosen if a client certificate (cainfo) was
    passed, resulting in problems like #18
    
    This adds a `--https` option enforcing https transport even in absence
    of certificate information.
    
    Fixes #18
    
    Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

Index: wsmancli-2.6.0/src/wsman.c
===================================================================
--- wsmancli-2.6.0.orig/src/wsman.c
+++ wsmancli-2.6.0/src/wsman.c
@@ -77,6 +77,7 @@ static char *proxy_upwd = NULL;
 
 
 static long int non_interactive = 0;
+static long int use_https = 0;
 static long int debug_level = -1;
 static char *encoding = NULL;
 static char *test_case = NULL;
@@ -185,6 +186,8 @@ static char wsman_parse_options(int argc
 	u_option_entry_t options[] = {
 		{"non-interactive", 0, U_OPTION_ARG_NONE, &non_interactive,
 			"Non interactive mode, don't ask for credentials", NULL},
+		{"https", 0, U_OPTION_ARG_NONE, &use_https,
+			"Enforce https scheme for transport", NULL},
 		{"version", 'q', U_OPTION_ARG_NONE, &my_version,
 			"Display application version", NULL},
 		{"debug", 'd', U_OPTION_ARG_INT, &debug_level,
@@ -672,7 +675,7 @@ int main(int argc, char **argv)
 		cl = wsmc_create(server,
 				server_port,
 				url_path,
-				cainfo ? "https" : "http",
+				(cainfo || use_https) ? "https" : "http",
 				username,
 				password);
 	}
openSUSE Build Service is sponsored by