diff options
author | Nokis Mavrogiannopoulos | 2007-12-08 16:07:12 +0000 |
---|---|---|
committer | Nokis Mavrogiannopoulos | 2007-12-08 16:07:12 +0000 |
commit | 8240f591e11b4c87c8f134515806d6cbd59bf9f2 (patch) | |
tree | 9225c0da012618b8d88d2562c9ee8024a523765e /src/gnutls_config.c | |
parent | 450f9e9e0b2f99e8aba697a0a9c9ce4899bed92f (diff) |
Added support for sending more than one certificate.
Diffstat (limited to 'src/gnutls_config.c')
-rw-r--r-- | src/gnutls_config.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gnutls_config.c b/src/gnutls_config.c index 7b5a42b..8d6308a 100644 --- a/src/gnutls_config.c +++ b/src/gnutls_config.c | |||
@@ -151,15 +151,10 @@ const char *mgs_set_cert_file(cmd_parms * parms, void *dummy, | |||
151 | "Certificate '%s'", file); | 151 | "Certificate '%s'", file); |
152 | } | 152 | } |
153 | 153 | ||
154 | ret = gnutls_x509_crt_init(&sc->cert_x509); | 154 | sc->certs_x509_num = MAX_CHAIN_SIZE; |
155 | if (ret < 0) { | ||
156 | return apr_psprintf(parms->pool, "GnuTLS: Failed to initialize" | ||
157 | ": (%d) %s", ret, gnutls_strerror(ret)); | ||
158 | } | ||
159 | |||
160 | ret = | 155 | ret = |
161 | gnutls_x509_crt_import(sc->cert_x509, &data, GNUTLS_X509_FMT_PEM); | 156 | gnutls_x509_crt_list_import(sc->certs_x509, &sc->certs_x509_num, &data, GNUTLS_X509_FMT_PEM, 0); |
162 | if (ret != 0) { | 157 | if (ret < 0) { |
163 | return apr_psprintf(parms->pool, "GnuTLS: Failed to Import " | 158 | return apr_psprintf(parms->pool, "GnuTLS: Failed to Import " |
164 | "Certificate '%s': (%d) %s", file, ret, | 159 | "Certificate '%s': (%d) %s", file, ret, |
165 | gnutls_strerror(ret)); | 160 | gnutls_strerror(ret)); |
@@ -440,7 +435,8 @@ void *mgs_config_server_create(apr_pool_t * p, server_rec * s) | |||
440 | sc->srp_tpasswd_conf_file = NULL; | 435 | sc->srp_tpasswd_conf_file = NULL; |
441 | sc->srp_tpasswd_file = NULL; | 436 | sc->srp_tpasswd_file = NULL; |
442 | sc->privkey_x509 = NULL; | 437 | sc->privkey_x509 = NULL; |
443 | sc->cert_x509 = NULL; | 438 | memset( sc->certs_x509, 0, sizeof(sc->certs_x509)); |
439 | sc->certs_x509_num = 0; | ||
444 | sc->cache_timeout = apr_time_from_sec(300); | 440 | sc->cache_timeout = apr_time_from_sec(300); |
445 | sc->cache_type = mgs_cache_dbm; | 441 | sc->cache_type = mgs_cache_dbm; |
446 | sc->cache_config = ap_server_root_relative(p, "conf/gnutls_cache"); | 442 | sc->cache_config = ap_server_root_relative(p, "conf/gnutls_cache"); |