]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/testhttp.c
Merge changes from CUPS 1.6svn-r10002
[thirdparty/cups.git] / cups / testhttp.c
index 959b6175fa38c66ae9d3d88c35dcabfd77c726f0..a133f823378e3c8a03f7a143bd9cfa78d05b536a 100644 (file)
@@ -167,6 +167,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 {
   int          i, j, k;                /* Looping vars */
   http_t       *http;                  /* HTTP connection */
+  http_encryption_t encryption;                /* Encryption type */
   http_status_t        status;                 /* Status of GET command */
   int          failures;               /* Number of test failures */
   char         buffer[8192];           /* Input buffer */
@@ -541,7 +542,13 @@ main(int  argc,                            /* I - Number of command-line arguments */
                     hostname, sizeof(hostname), &port,
                    resource, sizeof(resource));
 
-    http = httpConnectEncrypt(hostname, port, HTTP_ENCRYPT_IF_REQUESTED);
+    if (!_cups_strcasecmp(scheme, "https") || !_cups_strcasecmp(scheme, "ipps") ||
+        port == 443)
+      encryption = HTTP_ENCRYPT_ALWAYS;
+    else
+      encryption = HTTP_ENCRYPT_IF_REQUESTED;
+
+    http = httpConnectEncrypt(hostname, port, encryption);
     if (http == NULL)
     {
       perror(hostname);
@@ -558,7 +565,6 @@ main(int  argc,                             /* I - Number of command-line arguments */
     else
       printf("GET failed with status %d...\n", status);
 
-
     start  = time(NULL);
     length = httpGetLength2(http);
     total  = 0;