64d608a
diff -up cups-2.2.6/cups/http-private.h.remove-weak-ciphers cups-2.2.6/cups/http-private.h
64d608a
--- cups-2.2.6/cups/http-private.h.remove-weak-ciphers	2017-11-01 15:57:53.000000000 +0100
64d608a
+++ cups-2.2.6/cups/http-private.h	2018-08-07 11:53:54.985633959 +0200
64d608a
@@ -180,13 +180,17 @@ extern "C" {
64d608a
 
64d608a
 #  define _HTTP_TLS_NONE	0	/* No TLS options */
64d608a
 #  define _HTTP_TLS_ALLOW_RC4	1	/* Allow RC4 cipher suites */
64d608a
-#  define _HTTP_TLS_ALLOW_SSL3	2	/* Allow SSL 3.0 */
64d608a
-#  define _HTTP_TLS_ALLOW_DH	4	/* Allow DH/DHE key negotiation */
64d608a
-#  define _HTTP_TLS_DENY_TLS10	16	/* Deny TLS 1.0 */
64d608a
-#  define _HTTP_TLS_DENY_CBC	32	/* Deny CBC cipher suites */
64d608a
-#  define _HTTP_TLS_ONLY_TLS10  64      /* Only use TLS 1.0 */
64d608a
+#  define _HTTP_TLS_ALLOW_DH	2	/* Allow DH/DHE key negotiation */
64d608a
+#  define _HTTP_TLS_DENY_CBC	4	/* Deny CBC cipher suites */
64d608a
 #  define _HTTP_TLS_SET_DEFAULT 128     /* Setting the default TLS options */
64d608a
 
64d608a
+#  define _HTTP_TLS_SSL3	0	/* Min/max version is SSL/3.0 */
64d608a
+#  define _HTTP_TLS_1_0		1	/* Min/max version is TLS/1.0 */
64d608a
+#  define _HTTP_TLS_1_1		2	/* Min/max version is TLS/1.1 */
64d608a
+#  define _HTTP_TLS_1_2		3	/* Min/max version is TLS/1.2 */
64d608a
+#  define _HTTP_TLS_1_3		4	/* Min/max version is TLS/1.3 */
64d608a
+#  define _HTTP_TLS_MAX		5	/* Highest known TLS version */
64d608a
+
64d608a
 
64d608a
 /*
64d608a
  * Types and functions for SSL support...
64d608a
@@ -442,7 +446,7 @@ extern void		_httpTLSInitialize(void);
64d608a
 extern size_t		_httpTLSPending(http_t *http);
64d608a
 extern int		_httpTLSRead(http_t *http, char *buf, int len);
64d608a
 extern int		_httpTLSSetCredentials(http_t *http);
64d608a
-extern void		_httpTLSSetOptions(int options);
64d608a
+extern void		_httpTLSSetOptions(int options, int min_version, int max_version);
64d608a
 extern int		_httpTLSStart(http_t *http);
64d608a
 extern void		_httpTLSStop(http_t *http);
64d608a
 extern int		_httpTLSWrite(http_t *http, const char *buf, int len);
64d608a
diff -up cups-2.2.6/cups/tlscheck.c.remove-weak-ciphers cups-2.2.6/cups/tlscheck.c
64d608a
--- cups-2.2.6/cups/tlscheck.c.remove-weak-ciphers	2017-11-01 15:57:53.000000000 +0100
64d608a
+++ cups-2.2.6/cups/tlscheck.c	2018-08-07 11:53:54.987633942 +0200
64d608a
@@ -54,6 +54,8 @@ main(int  argc,				/* I - Number of comm
64d608a
   int		af = AF_UNSPEC,		/* Address family */
64d608a
 		tls_options = _HTTP_TLS_NONE,
64d608a
 					/* TLS options */
64d608a
+		tls_min_version = _HTTP_TLS_1_0,
64d608a
+		tls_max_version = _HTTP_TLS_MAX,
64d608a
 		verbose = 0;		/* Verbosity */
64d608a
   ipp_t		*request,		/* IPP Get-Printer-Attributes request */
64d608a
 		*response;		/* IPP Get-Printer-Attributes response */
64d608a
@@ -88,11 +90,12 @@ main(int  argc,				/* I - Number of comm
64d608a
     }
64d608a
     else if (!strcmp(argv[i], "--no-tls10"))
64d608a
     {
64d608a
-      tls_options |= _HTTP_TLS_DENY_TLS10;
64d608a
+      tls_min_version = _HTTP_TLS_1_1;
64d608a
     }
64d608a
     else if (!strcmp(argv[i], "--tls10"))
64d608a
     {
64d608a
-      tls_options |= _HTTP_TLS_ONLY_TLS10;
64d608a
+      tls_min_version = _HTTP_TLS_1_0;
64d608a
+      tls_max_version = _HTTP_TLS_1_0;
64d608a
     }
64d608a
     else if (!strcmp(argv[i], "--rc4"))
64d608a
     {
64d608a
@@ -148,7 +151,7 @@ main(int  argc,				/* I - Number of comm
64d608a
   if (!port)
64d608a
     port = 631;
64d608a
 
64d608a
-  _httpTLSSetOptions(tls_options);
64d608a
+  _httpTLSSetOptions(tls_options, tls_min_version, tls_max_version);
64d608a
 
64d608a
   http = httpConnect2(server, port, NULL, af, HTTP_ENCRYPTION_ALWAYS, 1, 30000, NULL);
64d608a
   if (!http)
64d608a
diff -up cups-2.2.6/cups/tls-darwin.c.remove-weak-ciphers cups-2.2.6/cups/tls-darwin.c
64d608a
--- cups-2.2.6/cups/tls-darwin.c.remove-weak-ciphers	2017-11-01 15:57:53.000000000 +0100
64d608a
+++ cups-2.2.6/cups/tls-darwin.c	2018-08-07 11:53:54.986633951 +0200
64d608a
@@ -53,7 +53,9 @@ static char		*tls_keypath = NULL;
64d608a
 					/* Server cert keychain path */
64d608a
 static _cups_mutex_t	tls_mutex = _CUPS_MUTEX_INITIALIZER;
64d608a
 					/* Mutex for keychain/certs */
64d608a
-static int		tls_options = -1;/* Options for TLS connections */
64d608a
+static int		tls_options = -1,/* Options for TLS connections */
64d608a
+			tls_min_version = _HTTP_TLS_1_0,
64d608a
+			tls_max_version = _HTTP_TLS_MAX;
64d608a
 
64d608a
 
64d608a
 /*
64d608a
@@ -1139,10 +1141,16 @@ _httpTLSRead(http_t *http,		/* I - HTTP
64d608a
  */
64d608a
 
64d608a
 void
64d608a
-_httpTLSSetOptions(int options)		/* I - Options */
64d608a
+_httpTLSSetOptions(int options,		/* I - Options */
64d608a
+                   int min_version,	/* I - Minimum TLS version */
64d608a
+                   int max_version)	/* I - Maximum TLS version */
64d608a
 {
64d608a
   if (!(options & _HTTP_TLS_SET_DEFAULT) || tls_options < 0)
64d608a
-    tls_options = options;
64d608a
+  {
64d608a
+    tls_options     = options;
64d608a
+    tls_min_version = min_version;
64d608a
+    tls_max_version = max_version;
64d608a
+  }
64d608a
 }
64d608a
 
64d608a
 
64d608a
@@ -1174,7 +1182,7 @@ _httpTLSStart(http_t *http)		/* I - HTTP
64d608a
   {
64d608a
     DEBUG_puts("4_httpTLSStart: Setting defaults.");
64d608a
     _cupsSetDefaults();
64d608a
-    DEBUG_printf(("4_httpTLSStart: tls_options=%x", tls_options));
64d608a
+    DEBUG_printf(("4_httpTLSStart: tls_options=%x, tls_min_version=%d, tls_max_version=%d", tls_options, tls_min_version, tls_max_version));
64d608a
   }
64d608a
 
64d608a
 #ifdef HAVE_SECKEYCHAINOPEN
64d608a
@@ -1217,22 +1225,23 @@ _httpTLSStart(http_t *http)		/* I - HTTP
64d608a
 
64d608a
   if (!error)
64d608a
   {
64d608a
-    SSLProtocol minProtocol;
64d608a
-
64d608a
-    if (tls_options & _HTTP_TLS_DENY_TLS10)
64d608a
-      minProtocol = kTLSProtocol11;
64d608a
-    else if (tls_options & _HTTP_TLS_ALLOW_SSL3)
64d608a
-      minProtocol = kSSLProtocol3;
64d608a
-    else
64d608a
-      minProtocol = kTLSProtocol1;
64d608a
+    static const SSLProtocol protocols[] =	/* Min/max protocol versions */
64d608a
+    {
64d608a
+      kSSLProtocol3,
64d608a
+      kTLSProtocol1,
64d608a
+      kTLSProtocol11,
64d608a
+      kTLSProtocol12,
64d608a
+      kTLSProtocol13,
64d608a
+      kTLSProtocolMaxSupported
64d608a
+    };
64d608a
 
64d608a
-    error = SSLSetProtocolVersionMin(http->tls, minProtocol);
64d608a
-    DEBUG_printf(("4_httpTLSStart: SSLSetProtocolVersionMin(%d), error=%d", minProtocol, (int)error));
64d608a
+    error = SSLSetProtocolVersionMin(http->tls, protocols[tls_min_version]);
64d608a
+    DEBUG_printf(("4_httpTLSStart: SSLSetProtocolVersionMin(%d), error=%d", protocols[tls_min_version], (int)error));
64d608a
 
64d608a
-    if (!error && (tls_options & _HTTP_TLS_ONLY_TLS10))
64d608a
+    if (!error)
64d608a
     {
64d608a
-      error = SSLSetProtocolVersionMax(http->tls, kTLSProtocol1);
64d608a
-      DEBUG_printf(("4_httpTLSStart: SSLSetProtocolVersionMax(kTLSProtocol1), error=%d", (int)error));
64d608a
+      error = SSLSetProtocolVersionMax(http->tls, protocols[tls_max_version]);
64d608a
+      DEBUG_printf(("4_httpTLSStart: SSLSetProtocolVersionMax(%d), error=%d", protocols[tls_max_version], (int)error));
64d608a
     }
64d608a
   }
64d608a
 
64d608a
diff -up cups-2.2.6/cups/tls-gnutls.c.remove-weak-ciphers cups-2.2.6/cups/tls-gnutls.c
64d608a
--- cups-2.2.6/cups/tls-gnutls.c.remove-weak-ciphers	2017-11-01 15:57:53.000000000 +0100
64d608a
+++ cups-2.2.6/cups/tls-gnutls.c	2018-08-07 11:58:45.164114342 +0200
64d608a
@@ -35,7 +35,9 @@ static char		*tls_keypath = NULL;
64d608a
 					/* Server cert keychain path */
64d608a
 static _cups_mutex_t	tls_mutex = _CUPS_MUTEX_INITIALIZER;
64d608a
 					/* Mutex for keychain/certs */
64d608a
-static int		tls_options = -1;/* Options for TLS connections */
64d608a
+static int		tls_options = -1,/* Options for TLS connections */
64d608a
+			tls_min_version = _HTTP_TLS_1_0,
64d608a
+			tls_max_version = _HTTP_TLS_MAX;
64d608a
 
64d608a
 
64d608a
 /*
64d608a
@@ -1224,10 +1226,16 @@ _httpTLSSetCredentials(http_t *http)	/*
64d608a
  */
64d608a
 
64d608a
 void
64d608a
-_httpTLSSetOptions(int options)		/* I - Options */
64d608a
+_httpTLSSetOptions(int options, 		/* I - Options */
64d608a
+                   int min_version,             /* I - Minimum TLS version */
64d608a
+                   int max_version)             /* I - Maximum TLS version */
64d608a
 {
64d608a
   if (!(options & _HTTP_TLS_SET_DEFAULT) || tls_options < 0)
64d608a
-    tls_options = options;
64d608a
+  {
64d608a
+    tls_options     = options;
64d608a
+    tls_min_version = min_version;
64d608a
+    tls_max_version = max_version;
64d608a
+  }
64d608a
 }
64d608a
 
64d608a
 
64d608a
@@ -1245,6 +1253,16 @@ _httpTLSStart(http_t *http)		/* I - Conn
64d608a
 					/* TLS credentials */
64d608a
   char			priority_string[2048];
64d608a
 					/* Priority string */
64d608a
+  int			version;	/* Current version */
64d608a
+  static const char * const versions[] =/* SSL/TLS versions */
64d608a
+  {
64d608a
+    "VERS-SSL3.0",
64d608a
+    "VERS-TLS1.0",
64d608a
+    "VERS-TLS1.1",
64d608a
+    "VERS-TLS1.2",
64d608a
+    "VERS-TLS1.3",
64d608a
+    "VERS-TLS-ALL"
64d608a
+  };
64d608a
 
64d608a
 
64d608a
   DEBUG_printf(("3_httpTLSStart(http=%p)", http));
64d608a
@@ -1506,14 +1524,40 @@ _httpTLSStart(http_t *http)		/* I - Conn
64d608a
 
64d608a
   strlcpy(priority_string, "NORMAL", sizeof(priority_string));
64d608a
 
64d608a
-  if (tls_options & _HTTP_TLS_DENY_TLS10)
64d608a
-    strlcat(priority_string, ":+VERS-TLS-ALL:-VERS-TLS1.0:-VERS-SSL3.0", sizeof(priority_string));
64d608a
-  else if (tls_options & _HTTP_TLS_ALLOW_SSL3)
64d608a
+  if (tls_max_version < _HTTP_TLS_MAX)
64d608a
+  {
64d608a
+   /*
64d608a
+    * Require specific TLS versions...
64d608a
+    */
64d608a
+
64d608a
+    strlcat(priority_string, ":-VERS-TLS-ALL", sizeof(priority_string));
64d608a
+    for (version = tls_min_version; version <= tls_max_version; version ++)
64d608a
+    {
64d608a
+      strlcat(priority_string, ":+", sizeof(priority_string));
64d608a
+      strlcat(priority_string, versions[version], sizeof(priority_string));
64d608a
+    }
64d608a
+  }
64d608a
+  else if (tls_min_version == _HTTP_TLS_SSL3)
64d608a
+  {
64d608a
+   /*
64d608a
+    * Allow all versions of TLS and SSL/3.0...
64d608a
+    */
64d608a
+
64d608a
     strlcat(priority_string, ":+VERS-TLS-ALL:+VERS-SSL3.0", sizeof(priority_string));
64d608a
-  else if (tls_options & _HTTP_TLS_ONLY_TLS10)
64d608a
-    strlcat(priority_string, ":-VERS-TLS-ALL:-VERS-SSL3.0:+VERS-TLS1.0", sizeof(priority_string));
64d608a
+  }
64d608a
   else
64d608a
-    strlcat(priority_string, ":+VERS-TLS-ALL:-VERS-SSL3.0", sizeof(priority_string));
64d608a
+  {
64d608a
+   /*
64d608a
+    * Require a minimum version...
64d608a
+    */
64d608a
+
64d608a
+    strlcat(priority_string, ":+VERS-TLS-ALL", sizeof(priority_string));
64d608a
+    for (version = 0; version < tls_min_version; version ++)
64d608a
+    {
64d608a
+      strlcat(priority_string, ":-", sizeof(priority_string));
64d608a
+      strlcat(priority_string, versions[version], sizeof(priority_string));
64d608a
+    }
64d608a
+  }
64d608a
 
64d608a
   if (tls_options & _HTTP_TLS_ALLOW_RC4)
64d608a
     strlcat(priority_string, ":+ARCFOUR-128", sizeof(priority_string));
64d608a
diff -up cups-2.2.6/cups/tls-sspi.c.remove-weak-ciphers cups-2.2.6/cups/tls-sspi.c
64d608a
--- cups-2.2.6/cups/tls-sspi.c.remove-weak-ciphers	2017-11-01 15:57:53.000000000 +0100
64d608a
+++ cups-2.2.6/cups/tls-sspi.c	2018-08-07 11:53:54.986633951 +0200
64d608a
@@ -52,7 +52,9 @@
64d608a
  * Local globals...
64d608a
  */
64d608a
 
64d608a
-static int		tls_options = -1;/* Options for TLS connections */
64d608a
+static int		tls_options = -1,/* Options for TLS connections */
64d608a
+			tls_min_version = _HTTP_TLS_1_0,
64d608a
+			tls_max_version = _HTTP_TLS_MAX;
64d608a
 
64d608a
 
64d608a
 /*
64d608a
@@ -914,7 +916,11 @@ void
64d608a
 _httpTLSSetOptions(int options)		/* I - Options */
64d608a
 {
64d608a
   if (!(options & _HTTP_TLS_SET_DEFAULT) || tls_options < 0)
64d608a
-    tls_options = options;
64d608a
+  {
64d608a
+    tls_options     = options;
64d608a
+    tls_min_version = min_version;
64d608a
+    tls_max_version = max_version;
64d608a
+  }
64d608a
 }
64d608a
 
64d608a
 
64d608a
@@ -1782,14 +1788,14 @@ http_sspi_find_credentials(
64d608a
 #else
64d608a
   if (http->mode == _HTTP_MODE_SERVER)
64d608a
   {
64d608a
-    if (tls_options & _HTTP_TLS_ALLOW_SSL3)
64d608a
+    if (tls_min_version == _HTTP_TLS_SSL3)
64d608a
       SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_SERVER | SP_PROT_SSL3_SERVER;
64d608a
     else
64d608a
       SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_SERVER;
64d608a
   }
64d608a
   else
64d608a
   {
64d608a
-    if (tls_options & _HTTP_TLS_ALLOW_SSL3)
64d608a
+    if (tls_min_version == _HTTP_TLS_SSL3)
64d608a
       SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_CLIENT | SP_PROT_SSL3_CLIENT;
64d608a
     else
64d608a
       SchannelCred.grbitEnabledProtocols = SP_PROT_TLS1_CLIENT;
64d608a
diff -up cups-2.2.6/cups/usersys.c.remove-weak-ciphers cups-2.2.6/cups/usersys.c
64d608a
--- cups-2.2.6/cups/usersys.c.remove-weak-ciphers	2018-08-07 11:53:54.945634283 +0200
64d608a
+++ cups-2.2.6/cups/usersys.c	2018-08-07 11:53:54.987633942 +0200
64d608a
@@ -54,7 +54,9 @@
64d608a
 typedef struct _cups_client_conf_s	/**** client.conf config data ****/
64d608a
 {
64d608a
 #ifdef HAVE_SSL
64d608a
-  int			ssl_options;	/* SSLOptions values */
64d608a
+  int			ssl_options,	/* SSLOptions values */
64d608a
+			ssl_min_version,/* Minimum SSL/TLS version */
64d608a
+			ssl_max_version;/* Maximum SSL/TLS version */
64d608a
 #endif /* HAVE_SSL */
64d608a
   int			trust_first,	/* Trust on first use? */
64d608a
 			any_root,	/* Allow any (e.g., self-signed) root */
64d608a
@@ -957,7 +959,7 @@ _cupsSetDefaults(void)
64d608a
     cg->validate_certs = cc.validate_certs;
64d608a
 
64d608a
 #ifdef HAVE_SSL
64d608a
-  _httpTLSSetOptions(cc.ssl_options | _HTTP_TLS_SET_DEFAULT);
64d608a
+  _httpTLSSetOptions(cc.ssl_options | _HTTP_TLS_SET_DEFAULT, cc.ssl_min_version, cc.ssl_max_version);
64d608a
 #endif /* HAVE_SSL */
64d608a
 }
64d608a
 
64d608a
@@ -1336,7 +1338,9 @@ cups_set_ssl_options(
64d608a
   * SSLOptions [AllowRC4] [AllowSSL3] [AllowDH] [DenyTLS1.0] [None]
64d608a
   */
64d608a
 
64d608a
-  int	options = _HTTP_TLS_NONE;	/* SSL/TLS options */
64d608a
+  int	options = _HTTP_TLS_NONE,	/* SSL/TLS options */
64d608a
+	min_version = _HTTP_TLS_1_0,	/* Minimum SSL/TLS version */
64d608a
+	max_version = _HTTP_TLS_MAX;	/* Maximum SSL/TLS version */
64d608a
   char	temp[256],			/* Copy of value */
64d608a
 	*start,				/* Start of option */
64d608a
 	*end;				/* End of option */
64d608a
@@ -1364,20 +1368,38 @@ cups_set_ssl_options(
64d608a
     if (!_cups_strcasecmp(start, "AllowRC4"))
64d608a
       options |= _HTTP_TLS_ALLOW_RC4;
64d608a
     else if (!_cups_strcasecmp(start, "AllowSSL3"))
64d608a
-      options |= _HTTP_TLS_ALLOW_SSL3;
64d608a
+      min_version = _HTTP_TLS_SSL3;
64d608a
     else if (!_cups_strcasecmp(start, "AllowDH"))
64d608a
       options |= _HTTP_TLS_ALLOW_DH;
64d608a
     else if (!_cups_strcasecmp(start, "DenyCBC"))
64d608a
       options |= _HTTP_TLS_DENY_CBC;
64d608a
     else if (!_cups_strcasecmp(start, "DenyTLS1.0"))
64d608a
-      options |= _HTTP_TLS_DENY_TLS10;
64d608a
+      min_version = _HTTP_TLS_1_1;
64d608a
+    else if (!_cups_strcasecmp(start, "MaxTLS1.0"))
64d608a
+      max_version = _HTTP_TLS_1_0;
64d608a
+    else if (!_cups_strcasecmp(start, "MaxTLS1.1"))
64d608a
+      max_version = _HTTP_TLS_1_1;
64d608a
+    else if (!_cups_strcasecmp(start, "MaxTLS1.2"))
64d608a
+      max_version = _HTTP_TLS_1_2;
64d608a
+    else if (!_cups_strcasecmp(start, "MaxTLS1.3"))
64d608a
+      max_version = _HTTP_TLS_1_3;
64d608a
+    else if (!_cups_strcasecmp(start, "MinTLS1.0"))
64d608a
+      min_version = _HTTP_TLS_1_0;
64d608a
+    else if (!_cups_strcasecmp(start, "MinTLS1.1"))
64d608a
+      min_version = _HTTP_TLS_1_1;
64d608a
+    else if (!_cups_strcasecmp(start, "MinTLS1.2"))
64d608a
+      min_version = _HTTP_TLS_1_2;
64d608a
+    else if (!_cups_strcasecmp(start, "MinTLS1.3"))
64d608a
+      min_version = _HTTP_TLS_1_3;
64d608a
     else if (!_cups_strcasecmp(start, "None"))
64d608a
       options = _HTTP_TLS_NONE;
64d608a
   }
64d608a
 
64d608a
-  cc->ssl_options = options;
64d608a
+  cc->ssl_options     = options;
64d608a
+  cc->ssl_max_version = max_version;
64d608a
+  cc->ssl_min_version = min_version;
64d608a
 
64d608a
-  DEBUG_printf(("4cups_set_ssl_options(cc=%p, value=\"%s\") options=%x", (void *)cc, value, options));
64d608a
+  DEBUG_printf(("4cups_set_ssl_options(cc=%p, value=\"%s\") options=%x, min_version=%d, max_version=%d", (void *)cc, value, options, min_version, max_version));
64d608a
 }
64d608a
 #endif /* HAVE_SSL */
64d608a
 
64d608a
diff -up cups-2.2.6/man/client.conf.man.in.remove-weak-ciphers cups-2.2.6/man/client.conf.man.in
64d608a
--- cups-2.2.6/man/client.conf.man.in.remove-weak-ciphers	2017-11-01 15:57:53.000000000 +0100
64d608a
+++ cups-2.2.6/man/client.conf.man.in	2018-08-07 11:53:54.987633942 +0200
64d608a
@@ -10,7 +10,7 @@
64d608a
 .\" which should have been included with this file.  If this file is
64d608a
 .\" file is missing or damaged, see the license at "http://www.cups.org/".
64d608a
 .\"
64d608a
-.TH client.conf 5 "CUPS" "19 October 2017" "Apple Inc."
64d608a
+.TH client.conf 5 "CUPS" "3 November 2017" "Apple Inc."
64d608a
 .SH NAME
64d608a
 client.conf \- client configuration file for cups
64d608a
 .SH DESCRIPTION
64d608a
@@ -56,7 +56,7 @@ Specifies the address and optionally the
64d608a
 \fBServerName \fIhostname-or-ip-address\fR[\fI:port\fR]\fB/version=1.1\fR
64d608a
 Specifies the address and optionally the port to use when connecting to a server running CUPS 1.3.12 and earlier.
64d608a
 .TP 5
64d608a
-\fBSSLOptions \fR[\fIAllowDH\fR] [\fIAllowRC4\fR] [\fIAllowSSL3\fR] [\fIDenyCBC\fR] [\fIDenyTLS1.0\fR]
64d608a
+\fBSSLOptions \fR[\fIAllowDH\fR] [\fIAllowRC4\fR] [\fIAllowSSL3\fR] [\fIDenyCBC\fR] [\fIDenyTLS1.0\fR] [\fIMaxTLS1.0\fR] [\fIMaxTLS1.1\fR] [\fIMaxTLS1.2\fR] [\fIMaxTLS1.3\fR] [\fIMinTLS1.0\fR] [\fIMinTLS1.1\fR] [\fIMinTLS1.2\fR] [\fIMinTLS1.3\fR]
64d608a
 .TP 5
64d608a
 \fBSSLOptions None\fR
64d608a
 Sets encryption options (only in /etc/cups/client.conf).
64d608a
@@ -68,6 +68,9 @@ The \fIAllowRC4\fR option enables the 12
64d608a
 The \fIAllowSSL3\fR option enables SSL v3.0, which is required for some older clients that do not support TLS v1.0.
64d608a
 The \fIDenyCBC\fR option disables all CBC cipher suites.
64d608a
 The \fIDenyTLS1.0\fR option disables TLS v1.0 support - this sets the minimum protocol version to TLS v1.1.
64d608a
+The \fMinTLS\fR options set the minimum TLS version to support.
64d608a
+The \fMaxTLS\fR options set the maximum TLS version to support.
64d608a
+Not all operating systems support TLS 1.3 at this time.
64d608a
 .TP 5
64d608a
 \fBTrustOnFirstUse Yes\fR
64d608a
 .TP 5
64d608a
diff -up cups-2.2.6/man/cupsd.conf.man.in.remove-weak-ciphers cups-2.2.6/man/cupsd.conf.man.in
64d608a
--- cups-2.2.6/man/cupsd.conf.man.in.remove-weak-ciphers	2018-08-07 11:53:54.981633991 +0200
64d608a
+++ cups-2.2.6/man/cupsd.conf.man.in	2018-08-07 11:53:54.987633942 +0200
64d608a
@@ -432,10 +432,11 @@ The default is "Minimal".
64d608a
 Listens on the specified address and port for encrypted connections.
64d608a
 .\"#SSLOptions
64d608a
 .TP 5
64d608a
-\fBSSLOptions \fR[\fIAllowDH\fR] [\fIAllowRC4\fR] [\fIAllowSSL3\fR] [\fIDenyCBC\fR] [\fIDenyTLS1.0\fR]
64d608a
+.TP 5
64d608a
+\fBSSLOptions \fR[\fIAllowDH\fR] [\fIAllowRC4\fR] [\fIAllowSSL3\fR] [\fIDenyCBC\fR] [\fIDenyTLS1.0\fR] [\fIMaxTLS1.0\fR] [\fIMaxTLS1.1\fR] [\fIMaxTLS1.2\fR] [\fIMaxTLS1.3\fR] [\fIMinTLS1.0\fR] [\fIMinTLS1.1\fR] [\fIMinTLS1.2\fR] [\fIMinTLS1.3\fR]
64d608a
 .TP 5
64d608a
 \fBSSLOptions None\fR
64d608a
-Sets encryption options.
64d608a
+Sets encryption options (only in /etc/cups/client.conf).
64d608a
 By default, CUPS only supports encryption using TLS v1.0 or higher using known secure cipher suites.
64d608a
 Security is reduced when \fIAllow\fR options are used.
64d608a
 Security is enhanced when \fIDeny\fR options are used.
64d608a
@@ -444,6 +445,9 @@ The \fIAllowRC4\fR option enables the 12
64d608a
 The \fIAllowSSL3\fR option enables SSL v3.0, which is required for some older clients that do not support TLS v1.0.
64d608a
 The \fIDenyCBC\fR option disables all CBC cipher suites.
64d608a
 The \fIDenyTLS1.0\fR option disables TLS v1.0 support - this sets the minimum protocol version to TLS v1.1.
64d608a
+The \fMinTLS\fR options set the minimum TLS version to support.
64d608a
+The \fMaxTLS\fR options set the maximum TLS version to support.
64d608a
+Not all operating systems support TLS 1.3 at this time.
64d608a
 .\"#SSLPort
64d608a
 .TP 5
64d608a
 \fBSSLPort \fIport\fR
64d608a
diff -up cups-2.2.6/scheduler/conf.c.remove-weak-ciphers cups-2.2.6/scheduler/conf.c
64d608a
--- cups-2.2.6/scheduler/conf.c.remove-weak-ciphers	2018-08-07 11:53:54.981633991 +0200
64d608a
+++ cups-2.2.6/scheduler/conf.c	2018-08-07 11:53:54.988633934 +0200
64d608a
@@ -630,7 +630,7 @@ cupsdReadConfiguration(void)
64d608a
   cupsdSetString(&ServerKeychain, "/Library/Keychains/System.keychain");
64d608a
 #  endif /* HAVE_GNUTLS */
64d608a
 
64d608a
-  _httpTLSSetOptions(0);
64d608a
+  _httpTLSSetOptions(_HTTP_TLS_NONE, _HTTP_TLS_1_0, _HTTP_TLS_MAX);
64d608a
 #endif /* HAVE_SSL */
64d608a
 
64d608a
   language = cupsLangDefault();
64d608a
@@ -3024,7 +3024,9 @@ read_cupsd_conf(cups_file_t *fp)	/* I -
64d608a
       * SSLOptions [AllowRC4] [AllowSSL3] [AllowDH] [DenyCBC] [DenyTLS1.0] [None]
64d608a
       */
64d608a
 
64d608a
-      int	options = 0;		/* SSL/TLS options */
64d608a
+      int	options = _HTTP_TLS_NONE,/* SSL/TLS options */
64d608a
+		min_version = _HTTP_TLS_1_0,
64d608a
+		max_version = _HTTP_TLS_MAX;
64d608a
 
64d608a
       if (value)
64d608a
       {
64d608a
@@ -3048,24 +3050,40 @@ read_cupsd_conf(cups_file_t *fp)	/* I -
64d608a
 	  * Compare...
64d608a
 	  */
64d608a
 
64d608a
-          if (!_cups_strcasecmp(start, "AllowRC4"))
64d608a
+	  if (!_cups_strcasecmp(start, "AllowRC4"))
64d608a
 	    options |= _HTTP_TLS_ALLOW_RC4;
64d608a
-          else if (!_cups_strcasecmp(start, "AllowSSL3"))
64d608a
-	    options |= _HTTP_TLS_ALLOW_SSL3;
64d608a
+	  else if (!_cups_strcasecmp(start, "AllowSSL3"))
64d608a
+	    min_version = _HTTP_TLS_SSL3;
64d608a
 	  else if (!_cups_strcasecmp(start, "AllowDH"))
64d608a
 	    options |= _HTTP_TLS_ALLOW_DH;
64d608a
 	  else if (!_cups_strcasecmp(start, "DenyCBC"))
64d608a
 	    options |= _HTTP_TLS_DENY_CBC;
64d608a
 	  else if (!_cups_strcasecmp(start, "DenyTLS1.0"))
64d608a
-	    options |= _HTTP_TLS_DENY_TLS10;
64d608a
-          else if (!_cups_strcasecmp(start, "None"))
64d608a
-	    options = 0;
64d608a
+	    min_version = _HTTP_TLS_1_1;
64d608a
+	  else if (!_cups_strcasecmp(start, "MaxTLS1.0"))
64d608a
+	    max_version = _HTTP_TLS_1_0;
64d608a
+	  else if (!_cups_strcasecmp(start, "MaxTLS1.1"))
64d608a
+	    max_version = _HTTP_TLS_1_1;
64d608a
+	  else if (!_cups_strcasecmp(start, "MaxTLS1.2"))
64d608a
+	    max_version = _HTTP_TLS_1_2;
64d608a
+	  else if (!_cups_strcasecmp(start, "MaxTLS1.3"))
64d608a
+	    max_version = _HTTP_TLS_1_3;
64d608a
+	  else if (!_cups_strcasecmp(start, "MinTLS1.0"))
64d608a
+	    min_version = _HTTP_TLS_1_0;
64d608a
+	  else if (!_cups_strcasecmp(start, "MinTLS1.1"))
64d608a
+	    min_version = _HTTP_TLS_1_1;
64d608a
+	  else if (!_cups_strcasecmp(start, "MinTLS1.2"))
64d608a
+	    min_version = _HTTP_TLS_1_2;
64d608a
+	  else if (!_cups_strcasecmp(start, "MinTLS1.3"))
64d608a
+	    min_version = _HTTP_TLS_1_3;
64d608a
+	  else if (!_cups_strcasecmp(start, "None"))
64d608a
+	    options = _HTTP_TLS_NONE;
64d608a
 	  else if (_cups_strcasecmp(start, "NoEmptyFragments"))
64d608a
 	    cupsdLogMessage(CUPSD_LOG_WARN, "Unknown SSL option %s at line %d.", start, linenum);
64d608a
         }
64d608a
       }
64d608a
 
64d608a
-      _httpTLSSetOptions(options);
64d608a
+      _httpTLSSetOptions(options, min_version, max_version);
64d608a
     }
64d608a
 #endif /* HAVE_SSL */
64d608a
     else if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")