-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'meshtastic:master' into principale
- Loading branch information
Showing
8 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
etc/meshtasticd | ||
etc/meshtasticd/config.d | ||
etc/meshtasticd/available.d | ||
usr/share/meshtasticd/web | ||
usr/share/meshtasticd/web | ||
etc/meshtasticd/ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,9 @@ mail: [email protected] | |
#define DEFAULT_REALM "default_realm" | ||
#define PREFIX "" | ||
|
||
#define KEY_PATH settingsStrings[websslkeypath].c_str() | ||
#define CERT_PATH settingsStrings[websslcertpath].c_str() | ||
|
||
struct _file_config configWeb; | ||
|
||
// We need to specify some content-type mapping, so the resources get delivered with the | ||
|
@@ -384,13 +387,13 @@ char *read_file_into_string(const char *filename) | |
int PiWebServerThread::CheckSSLandLoad() | ||
{ | ||
// read certificate | ||
cert_pem = read_file_into_string("certificate.pem"); | ||
cert_pem = read_file_into_string(CERT_PATH); | ||
if (cert_pem == NULL) { | ||
LOG_ERROR("ERROR SSL Certificate File can't be loaded or is missing"); | ||
return 1; | ||
} | ||
// read private key | ||
key_pem = read_file_into_string("private_key.pem"); | ||
key_pem = read_file_into_string(KEY_PATH); | ||
if (key_pem == NULL) { | ||
LOG_ERROR("ERROR file private_key can't be loaded or is missing"); | ||
return 2; | ||
|
@@ -415,8 +418,8 @@ int PiWebServerThread::CreateSSLCertificate() | |
return 2; | ||
} | ||
|
||
// Ope file to write private key file | ||
FILE *pkey_file = fopen("private_key.pem", "wb"); | ||
// Open file to write private key file | ||
FILE *pkey_file = fopen(KEY_PATH, "wb"); | ||
if (!pkey_file) { | ||
LOG_ERROR("Error opening private key file"); | ||
return 3; | ||
|
@@ -426,18 +429,19 @@ int PiWebServerThread::CreateSSLCertificate() | |
fclose(pkey_file); | ||
|
||
// open Certificate file | ||
FILE *x509_file = fopen("certificate.pem", "wb"); | ||
FILE *x509_file = fopen(CERT_PATH, "wb"); | ||
if (!x509_file) { | ||
LOG_ERROR("Error opening cert"); | ||
return 4; | ||
} | ||
// write cirtificate | ||
// write certificate | ||
PEM_write_X509(x509_file, x509); | ||
fclose(x509_file); | ||
|
||
EVP_PKEY_free(pkey); | ||
LOG_INFO("Create SSL Key %s successful", KEY_PATH); | ||
X509_free(x509); | ||
LOG_INFO("Create SSL Cert -certificate.pem- succesfull "); | ||
LOG_INFO("Create SSL Cert %s successful", CERT_PATH); | ||
return 0; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters