set a default acme provider (letsencrypt)

This commit is contained in:
Joris Vink 2019-11-06 14:01:28 +01:00
parent c55ec5c0d8
commit bb159da725
3 changed files with 16 additions and 0 deletions

View File

@ -44,6 +44,7 @@ extern "C" {
#define KORE_ACME_CHALLENGE_SET_CERT (KORE_MSG_ACME_BASE + 21)
#define KORE_ACME_CHALLENGE_CLEAR_CERT (KORE_MSG_ACME_BASE + 22)
void kore_acme_init(void);
void kore_acme_run(void);
void kore_acme_setup(void);

View File

@ -48,6 +48,12 @@
#define ACME_STATUS_EXPIRED 6
#define ACME_STATUS_REVOKED 7
/*
* The default provider is letsencrypt, can be overwritten via the config
* file its acme_provider setting.
*/
#define ACME_DEFAULT_PROVIDER "https://acme-v02.api.letsencrypt.org/directory"
#if defined(__linux__)
#include "seccomp.h"
@ -241,6 +247,12 @@ char *acme_root_path = NULL;
char *acme_runas_user = NULL;
u_int32_t acme_request_timeout = 8;
void
kore_acme_init(void)
{
acme_provider = kore_strdup(ACME_DEFAULT_PROVIDER);
}
void
kore_acme_run(void)
{

View File

@ -259,6 +259,9 @@ main(int argc, char *argv[])
kore_auth_init();
kore_validator_init();
kore_filemap_init();
#endif
#if defined(KORE_USE_ACME)
kore_acme_init();
#endif
kore_domain_init();
kore_module_init();