From 8322be944208d77ff9e7d992e05855f063d0b775 Mon Sep 17 00:00:00 2001 From: Nokis Mavrogiannopoulos Date: Thu, 21 May 2009 18:48:34 +0000 Subject: if private key import fails try as pkcs8 key. --- src/gnutls_config.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gnutls_config.c b/src/gnutls_config.c index 0a56b38..3ff3b34 100644 --- a/src/gnutls_config.c +++ b/src/gnutls_config.c @@ -194,7 +194,12 @@ const char *mgs_set_key_file(cmd_parms * parms, void *dummy, ret = gnutls_x509_privkey_import(sc->privkey_x509, &data, GNUTLS_X509_FMT_PEM); - if (ret != 0) { + + if (ret < 0) + ret = gnutls_x509_privkey_import_pkcs8 (sc->privkey_x509, &data, GNUTLS_X509_FMT_PEM, + NULL, GNUTLS_PKCS_PLAIN); + + if (ret < 0) { return apr_psprintf(parms->pool, "GnuTLS: Failed to Import " "Private Key '%s': (%d) %s", file, ret, gnutls_strerror(ret)); -- cgit