diff options
| author | 2025-10-23 11:56:39 +0100 | |
|---|---|---|
| committer | 2025-10-23 11:56:39 +0100 | |
| commit | f8abb97710357f6cc60f84a7cd494ad23cd5fed8 (patch) | |
| tree | dea01775c5f620802d4d23feb45492386ef0a3cd /modules/extra/ssl_openssl.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
| parent | Set the security level on the client context as well as the server one. (diff) | |
Merge branch 'insp4' into master.
Diffstat (limited to 'modules/extra/ssl_openssl.cpp')
| -rw-r--r-- | modules/extra/ssl_openssl.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/modules/extra/ssl_openssl.cpp b/modules/extra/ssl_openssl.cpp index 8283cd59d..3593e8a8c 100644 --- a/modules/extra/ssl_openssl.cpp +++ b/modules/extra/ssl_openssl.cpp @@ -368,19 +368,26 @@ namespace OpenSSL } std::string grouplist = "X25519MLKEM768:X25519:prime256v1"; - const auto strictgroups = tag->readString("groups", grouplist); - if (!grouplist.empty() && !ctx.SetGroups(grouplist, tag->getBool("strictgroups", strictgroups))) + auto strictgroups = tag->readString("groups", grouplist); + if (!grouplist.empty()) { - ERR_print_errors_cb(error_callback, this); - throw Exception("Couldn't set groups: " + lasterr); + strictgroups = tag->getBool("strictgroups", strictgroups); + if (!ctx.SetGroups(grouplist, strictgroups) || !clientctx.SetGroups(grouplist, strictgroups)) + { + ERR_print_errors_cb(error_callback, this); + throw Exception("Couldn't set groups: " + lasterr); + } } SetContextOptions("server", tag, ctx); SetContextOptions("client", tag, clientctx); - const auto securitylevel = tag->getNum<int>("securitylevel", 0, 0, 10); - if (securitylevel) + const auto securitylevel = tag->getNum<int>("securitylevel", -1, -1, 10); + if (securitylevel >= 0) + { ctx.SetSecurityLevel(securitylevel); + clientctx.SetSecurityLevel(securitylevel); + } /* Load our keys and certificates * NOTE: OpenSSL's error logging API sucks, don't blame us for this clusterfuck. |
