From 7ef38d4e50d58d0e9e2494b8f71cf16a85b13b17 Mon Sep 17 00:00:00 2001 From: Nikos 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(-) (limited to 'src') 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