diff --git a/modules/extra/ssl_gnutls.cpp b/modules/extra/ssl_gnutls.cpp index 4d399feb9..e2c9aa23c 100644 --- a/modules/extra/ssl_gnutls.cpp +++ b/modules/extra/ssl_gnutls.cpp @@ -318,7 +318,7 @@ public: static void CheckFile(const Anope::string &filename) { - if (!Anope::IsFile(filename.c_str())) + if (!Anope::IsFile(filename)) { Log() << "File does not exist: " << filename; throw ConfigException("Error loading certificate/private key"); @@ -339,7 +339,7 @@ public: GnuTLS::X509CertCredentials *newcred = new GnuTLS::X509CertCredentials(certfile, keyfile); // DH params is not mandatory - if (Anope::IsFile(dhfile.c_str())) + if (Anope::IsFile(dhfile)) { try { diff --git a/modules/extra/ssl_openssl.cpp b/modules/extra/ssl_openssl.cpp index ec81e6ccb..0e6ad2abc 100644 --- a/modules/extra/ssl_openssl.cpp +++ b/modules/extra/ssl_openssl.cpp @@ -149,7 +149,7 @@ public: this->certfile = Anope::ExpandConfig(config->Get("cert", "fullchain.pem")); this->keyfile = Anope::ExpandConfig(config->Get("key", "privkey.pem")); - if (Anope::IsFile(this->certfile.c_str())) + if (Anope::IsFile(this->certfile)) { if (!SSL_CTX_use_certificate_chain_file(client_ctx, this->certfile.c_str()) || !SSL_CTX_use_certificate_chain_file(server_ctx, this->certfile.c_str())) throw ConfigException("Error loading certificate"); @@ -159,7 +159,7 @@ public: else Log() << "Unable to open certificate " << this->certfile; - if (Anope::IsFile(this->keyfile.c_str())) + if (Anope::IsFile(this->keyfile)) { if (!SSL_CTX_use_PrivateKey_file(client_ctx, this->keyfile.c_str(), SSL_FILETYPE_PEM) || !SSL_CTX_use_PrivateKey_file(server_ctx, this->keyfile.c_str(), SSL_FILETYPE_PEM)) throw ConfigException("Error loading private key"); @@ -168,7 +168,7 @@ public: } else { - if (Anope::IsFile(this->certfile.c_str())) + if (Anope::IsFile(this->certfile)) throw ConfigException("Error loading private key " + this->keyfile + " - file not found"); else Log() << "Unable to open private key " << this->keyfile;