Skip to content

Commit

Permalink
GSvarServer: removed ssl_certificate_chain config parameter, the chai…
Browse files Browse the repository at this point in the history
…n will be read from the certificate file
  • Loading branch information
ubuntolog committed Oct 24, 2024
1 parent ef13f17 commit c23b969
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion bin/GSvarServer.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ megsap_settings_ini = ""

#SSL certificate-key pair needed for HTTPS
ssl_certificate = "certificate.crt"
ssl_certificate_chain = ""
ssl_key = "certificate.key"

#number of threads for parallel calculations, e.g. for coverage statistics
Expand Down
1 change: 0 additions & 1 deletion bin/settings_nightly.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ server_host = "127.0.0.1"
server_port =
ssl_certificate =
ssl_key =
ssl_certificate_chain =
session_duration = 36000

#NovaSeqX
Expand Down
1 change: 0 additions & 1 deletion doc/GSvarServer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The server is configurable via the GSVarServer.ini file located at the `./bin` f
These are the most important config parameters:

* `ssl_certificate` - location of your SSL certificate
* `ssl_certificate_chain` - If the certificate itself does not contain all information for validation of the certificate, you can provide this optional chertificate chain file. It is used e.g. for Let's encrypt certificates.
* `ssl_key` - location of your private key
* `server_port` - port used by the server
* `server_host` - domain name used be the server
Expand Down
15 changes: 6 additions & 9 deletions src/GSvarServer/ServerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@ ServerWrapper::ServerWrapper(const quint16& port)
return;
}

QList<QSslCertificate> ca_certificates = QSslCertificate::fromPath(ssl_certificate, QSsl::Pem);
if (ca_certificates.isEmpty())
{
Log::info("SSL certificate chain not found. Continue with the available key");
}

QString ssl_key = ServerHelper::getStringSettingsValue("ssl_key");
if (ssl_key.isEmpty())
{
ssl_key = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + QDir::separator() + "test-key.key";
Log::warn("SSL key has not been specified in the config. Using a test key: " + ssl_key);
}

QString ssl_chain = ServerHelper::getStringSettingsValue("ssl_certificate_chain");
QList<QSslCertificate> ca_certificates;
if (!ssl_chain.isEmpty())
{
Log::info("Reading SSL certificate chain file");
ca_certificates = QSslCertificate::fromPath(ssl_chain, QSsl::Pem);
}

QSslCertificate cert(&certFile);
QSslKey key = readPrivateKey(ssl_key);
if (key.isNull())
Expand All @@ -53,7 +51,6 @@ ServerWrapper::ServerWrapper(const quint16& port)
config.setLocalCertificate(cert);
config.setPrivateKey(key);


if (ca_certificates.size()>0)
{
Log::info("Loading SSL certificate chain");
Expand Down

0 comments on commit c23b969

Please sign in to comment.