Skip to content

Commit

Permalink
Use /etc/ssl/certs/ca-certificates.crt as a default file to verify se…
Browse files Browse the repository at this point in the history
…cured download
  • Loading branch information
OleksandrChaika committed Jul 3, 2023
1 parent 618d084 commit 5f57f36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/actions/build-native-binary/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ runs:
-keyout /etc/ssl/private/selfupdateagent.key \
-out /etc/ssl/certs/selfupdateagent.crt \
-config utest/sua-certificate.config
sudo tee -a /etc/ssl/certs/ca-certificates.crt < /etc/ssl/certs/selfupdateagent.crt > /dev/null
shell: bash

- name: Install and configure apache2
Expand Down
2 changes: 1 addition & 1 deletion src/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace sua {
std::shared_ptr<IBundleChecker> bundleChecker;
std::string updatesDirectory = "/data/selfupdates";
std::string tempFileName = "/temp_file";
std::string certificateFileName = "/etc/ssl/certs/selfupdateagent.crt";
std::string certificateFileName = "/etc/ssl/certs/ca-certificates.crt";
bool downloadMode = true;
bool fallbackMode = false;

Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SUA_SERVER sets and overrides MQTT server address to connect
-s, --server MQTT broker server to connect, has precedence over SUA_SERVER environment variable
(default is 'tcp://mosquitto:1883')
-c, --ca path to certificate to verify connection with bundle server
(default is '/etc/ssl/certs/selfupdateagent.crt')
(default is '/etc/ssl/certs/ca-certificates.crt')
-v, --version display version (Git hash and build number) used to build SUA and exit
)";

Expand All @@ -61,7 +61,7 @@ int main(int argc, char* argv[])
std::string server{"tcp://mosquitto:1883"};
std::string installer{"download"};
std::string hostPathToSelfupdateDir{"/data/selfupdates"};
std::string pathToCertificate{"/etc/ssl/certs/selfupdateagent.crt"};
std::string pathToCertificate{"/etc/ssl/certs/ca-certificates.crt"};

const char * env_server = std::getenv("SUA_SERVER");
if(env_server) {
Expand Down

0 comments on commit 5f57f36

Please sign in to comment.