summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLContext.cpp6
-rw-r--r--Swiften/TLS/TLSOptions.h8
2 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
index e585766..5c80976 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
@@ -329,25 +329,25 @@ bool OpenSSLContext::configure(const TLSOptions &options)
verifyCertCallback = *options.verifyCertificateCallback;
} else {
verifyCertCallback = nullptr;
}
if (options.verifyMode) {
TLSOptions::VerifyMode verify_mode = *options.verifyMode;
int mode;
switch (verify_mode) {
- case TLSOptions::VerifyMode::NONE:
+ case TLSOptions::VerifyMode::None:
mode = SSL_VERIFY_NONE;
break;
- case TLSOptions::VerifyMode::REQUIRED:
+ case TLSOptions::VerifyMode::Required:
mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT | SSL_VERIFY_CLIENT_ONCE;
break;
- case TLSOptions::VerifyMode::OPTIONAL:
+ case TLSOptions::VerifyMode::Optional:
mode = SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE;
break;
}
// Set up default certificate chain verification depth - may be overridden below
SSL_CTX_set_verify_depth(context_.get(), SSL_DEFAULT_VERIFY_DEPTH + 1);
// Set callbacks up
SSL_CTX_set_verify(context_.get(), mode, verifyCallback);
diff --git a/Swiften/TLS/TLSOptions.h b/Swiften/TLS/TLSOptions.h
index 7a38aa2..56648a3 100644
--- a/Swiften/TLS/TLSOptions.h
+++ b/Swiften/TLS/TLSOptions.h
@@ -45,22 +45,22 @@ namespace Swift {
/**
* Other OpenSSL configuration items
*/
boost::optional<std::string> cipherSuites;
boost::optional<std::string> context;
boost::optional<int> sessionCacheTimeout;
boost::optional<int> verifyDepth;
enum class VerifyMode {
- NONE,
- REQUIRED,
- OPTIONAL
- } ;
+ None,
+ Required,
+ Optional
+ };
boost::optional<VerifyMode> verifyMode;
/**
* Callback for certificate verification
*/
boost::optional<std::function<int(const TLSContext *)>> verifyCertificateCallback;
};
}