diff options
author | Michael Sweet <michael.r.sweet@gmail.com> | 2016-09-19 10:42:12 -0400 |
---|---|---|
committer | Michael Sweet <michael.r.sweet@gmail.com> | 2016-09-19 10:42:12 -0400 |
commit | efed05629f103469af91bc108f3b3fe02237a50d (patch) | |
tree | 51b6d8b667737a3a4d17f2d4970f549edc486268 /scheduler | |
parent | e8916f41d892d9f24837101c845f32d215bdc04d (diff) |
Add CreateSelfSignedCerts directive for cups-files.conf (Issue #4876)
Diffstat (limited to 'scheduler')
-rw-r--r-- | scheduler/conf.c | 8 | ||||
-rw-r--r-- | scheduler/conf.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/scheduler/conf.c b/scheduler/conf.c index 088501e88..8110cb475 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -138,6 +138,9 @@ static const cupsd_var_t cupsfiles_vars[] = { "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING }, { "CacheDir", &CacheDir, CUPSD_VARTYPE_STRING }, { "ConfigFilePerm", &ConfigFilePerm, CUPSD_VARTYPE_PERM }, +#ifdef HAVE_SSL + { "CreateSelfSignedCerts", &CreateSelfSignedCerts, CUPSD_VARTYPE_BOOLEAN }, +#endif /* HAVE_SSL */ { "DataDir", &DataDir, CUPSD_VARTYPE_STRING }, { "DocumentRoot", &DocumentRoot, CUPSD_VARTYPE_STRING }, { "ErrorLog", &ErrorLog, CUPSD_VARTYPE_STRING }, @@ -739,6 +742,7 @@ cupsdReadConfiguration(void) FatalErrors = parse_fatal_errors(CUPS_DEFAULT_FATAL_ERRORS); default_auth_type = CUPSD_AUTH_BASIC; #ifdef HAVE_SSL + CreateSelfSignedCerts = TRUE; DefaultEncryption = HTTP_ENCRYPT_REQUIRED; #endif /* HAVE_SSL */ DirtyCleanInterval = DEFAULT_KEEPALIVE; @@ -1181,7 +1185,9 @@ cupsdReadConfiguration(void) cupsdSetStringf(&ServerKeychain, "%s/%s", ServerRoot, ServerKeychain); cupsdLogMessage(CUPSD_LOG_DEBUG, "Using keychain \"%s\" for server name \"%s\".", ServerKeychain, ServerName); - cupsSetServerCredentials(ServerKeychain, ServerName, 1); + if (!CreateSelfSignedCerts) + cupsdLogMessage(CUPSD_LOG_DEBUG, "Self-signed TLS certificate generation is disabled."); + cupsSetServerCredentials(ServerKeychain, ServerName, CreateSelfSignedCerts); #endif /* HAVE_SSL */ /* diff --git a/scheduler/conf.h b/scheduler/conf.h index 80250d94d..585ba9203 100644 --- a/scheduler/conf.h +++ b/scheduler/conf.h @@ -240,6 +240,8 @@ VAR const char **MimeTypes VALUE(NULL); /* Array of MIME types */ #ifdef HAVE_SSL +VAR int CreateSelfSignedCerts VALUE(TRUE); + /* Automatically create self-signed certs? */ VAR char *ServerKeychain VALUE(NULL); /* Keychain holding cert + key */ #endif /* HAVE_SSL */ |