diff options
author | Nokis Mavrogiannopoulos | 2009-05-21 18:48:34 +0000 |
---|---|---|
committer | Nokis Mavrogiannopoulos | 2009-05-21 18:48:34 +0000 |
commit | 8322be944208d77ff9e7d992e05855f063d0b775 (patch) | |
tree | 99bb4cbe8b717b4157dc6bf32a085f493063272c /src/gnutls_config.c | |
parent | 13494386eec6efd9650f7383ae081393bed7e152 (diff) |
if private key import fails try as pkcs8 key.
Diffstat (limited to 'src/gnutls_config.c')
-rw-r--r-- | src/gnutls_config.c | 7 |
1 files changed, 6 insertions, 1 deletions
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, | |||
194 | ret = | 194 | ret = |
195 | gnutls_x509_privkey_import(sc->privkey_x509, &data, | 195 | gnutls_x509_privkey_import(sc->privkey_x509, &data, |
196 | GNUTLS_X509_FMT_PEM); | 196 | GNUTLS_X509_FMT_PEM); |
197 | if (ret != 0) { | 197 | |
198 | if (ret < 0) | ||
199 | ret = gnutls_x509_privkey_import_pkcs8 (sc->privkey_x509, &data, GNUTLS_X509_FMT_PEM, | ||
200 | NULL, GNUTLS_PKCS_PLAIN); | ||
201 | |||
202 | if (ret < 0) { | ||
198 | return apr_psprintf(parms->pool, "GnuTLS: Failed to Import " | 203 | return apr_psprintf(parms->pool, "GnuTLS: Failed to Import " |
199 | "Private Key '%s': (%d) %s", file, ret, | 204 | "Private Key '%s': (%d) %s", file, ret, |
200 | gnutls_strerror(ret)); | 205 | gnutls_strerror(ret)); |