Skip to content

Commit 69615a8

Browse files
committed
Merge branch '23.08' into 24.02
2 parents 608f9fe + 43a2cc8 commit 69615a8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Documentation/Getting-Started/Configuration-Guide.md

+4
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,10 @@ The path to the TLS private key in PEM format for the admin interface.
15381538
If the `admin_ssl_key` and `admin_ssl_cert` options are all defined, the admin
15391539
interface will use encrypted HTTPS instead of plain HTTP.
15401540

1541+
The REST-API only supports PKCS#8 PEM private keys and using a PKCS#1 PEM
1542+
private key will result in an error. If your private key is in PKCS#1 PEM
1543+
format, convert it to PKCS#8 PEM format first before starting up MaxScale.
1544+
15411545
### `admin_ssl_cert`
15421546

15431547
- **Type**: path

server/core/admin.cc

+12-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,18 @@ std::unique_ptr<Creds> Creds::create(const std::string& cert_file, const std::st
330330
}
331331
else
332332
{
333-
MXB_ERROR("Failed to load REST API TLS private key: %s", gnutls_strerror(rc));
333+
const char* errmsg = gnutls_strerror(rc);
334+
MXB_ERROR("Failed to load REST API TLS private key: %s", errmsg);
335+
336+
const char NEEDLE[] = "BEGIN RSA PRIVATE KEY";
337+
338+
if (strstr(errmsg, "ASN1 parser: Error in DER parsing")
339+
&& memmem(key.data(), key.size(), NEEDLE, sizeof(NEEDLE) - 1))
340+
{
341+
MXB_ERROR("This error may be caused by a PKCS#1 formatted PEM private key. "
342+
"Convert the key to PKCS#8 and try again.");
343+
}
344+
334345
gnutls_privkey_deinit(pkey);
335346

336347
for (auto& certificate : pcerts)

0 commit comments

Comments
 (0)