[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 29/39: http3: Load certificates from the configuration file.
From: |
gnunet |
Subject: |
[gnunet] 29/39: http3: Load certificates from the configuration file. |
Date: |
Sun, 25 Aug 2024 15:16:25 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 5f8ff699647eff417c609d10b86e4412ea1a22e0
Author: Shichao <mrrr61@outlook.com>
AuthorDate: Mon Jul 29 16:37:20 2024 +0800
http3: Load certificates from the configuration file.
---
src/service/transport/gnunet-communicator-http3.c | 36 ++++++++++++++++++++--
.../test_communicator_http3_basic_peer1.conf | 2 ++
.../test_communicator_http3_basic_peer2.conf | 4 ++-
3 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/src/service/transport/gnunet-communicator-http3.c
b/src/service/transport/gnunet-communicator-http3.c
index 4e61ce031..cdf8c4b15 100644
--- a/src/service/transport/gnunet-communicator-http3.c
+++ b/src/service/transport/gnunet-communicator-http3.c
@@ -3171,6 +3171,8 @@ run (void *cls,
socklen_t in_len;
struct sockaddr_storage in_sto;
socklen_t sto_len;
+ char *cert_file;
+ char *key_file;
(void) cls;
cfg = c;
@@ -3185,6 +3187,31 @@ run (void *cls,
"BINDTO");
return;
}
+
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ COMMUNICATOR_CONFIG_SECTION,
+ "KEY_FILE",
+ &key_file))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ COMMUNICATOR_CONFIG_SECTION,
+ "KEY_FILE");
+ return;
+ }
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ COMMUNICATOR_CONFIG_SECTION,
+ "CERT_FILE",
+ &cert_file))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ COMMUNICATOR_CONFIG_SECTION,
+ "CERT_FILE");
+ GNUNET_free (key_file);
+ return;
+ }
+
disable_v6 = GNUNET_NO;
if ((GNUNET_NO == GNUNET_NETWORK_test_pf (PF_INET6)) ||
(GNUNET_YES ==
@@ -3292,9 +3319,14 @@ run (void *cls,
return;
}
rv = gnutls_certificate_set_x509_key_file (cred,
- "credentials/server.pem",
- "credentials/server-key.pem",
+ cert_file,
+ key_file,
GNUTLS_X509_FMT_PEM);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "key_file: %s\ncert_file: %s\n",
+ key_file, cert_file);
+ GNUNET_free (cert_file);
+ GNUNET_free (key_file);
if (rv < 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/service/transport/test_communicator_http3_basic_peer1.conf
b/src/service/transport/test_communicator_http3_basic_peer1.conf
index b917c19c4..f2daba8d1 100644
--- a/src/service/transport/test_communicator_http3_basic_peer1.conf
+++ b/src/service/transport/test_communicator_http3_basic_peer1.conf
@@ -43,3 +43,5 @@ MAX_QUEUE_LENGTH=5000
[communicator-http3]
BINDTO = 60002
DISABLE_V6 = YES
+KEY_FILE = credentials/server-key2.pem
+CERT_FILE = credentials/server2.pem
diff --git a/src/service/transport/test_communicator_http3_basic_peer2.conf
b/src/service/transport/test_communicator_http3_basic_peer2.conf
index 27fd63bac..08ddf94fb 100644
--- a/src/service/transport/test_communicator_http3_basic_peer2.conf
+++ b/src/service/transport/test_communicator_http3_basic_peer2.conf
@@ -42,4 +42,6 @@ MAX_QUEUE_LENGTH=5000
[communicator-http3]
BINDTO = 60003
-DISABLE_V6 = YES
\ No newline at end of file
+DISABLE_V6 = YES
+KEY_FILE = credentials/server-key2.pem
+CERT_FILE = credentials/server2.pem
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 21/39: http3: Remove some unused code, (continued)
- [gnunet] 21/39: http3: Remove some unused code, gnunet, 2024/08/25
- [gnunet] 17/39: http3: Update TODOs, gnunet, 2024/08/25
- [gnunet] 11/39: http3: use multiple streams, gnunet, 2024/08/25
- [gnunet] 30/39: http3: Autogenerate certificate when there is no certificate in the configuration file., gnunet, 2024/08/25
- [gnunet] 24/39: http3: Finish HTTP3 layer and now can pass the basic test., gnunet, 2024/08/25
- [gnunet] 23/39: http3: Fix bugs when creating a new HTTP server, gnunet, 2024/08/25
- [gnunet] 18/39: http3: add the timer after sending and writing packets, gnunet, 2024/08/25
- [gnunet] 36/39: http3: Implement bidirect and pass the test., gnunet, 2024/08/25
- [gnunet] 27/39: http3: better http3 detection logic, gnunet, 2024/08/25
- [gnunet] 28/39: http3: Gracefully delete closed connections., gnunet, 2024/08/25
- [gnunet] 29/39: http3: Load certificates from the configuration file.,
gnunet <=
- [gnunet] 34/39: http3: Change some functions and parameters to static., gnunet, 2024/08/25
- [gnunet] 31/39: http3: Fix certificate loading; fix meson install of files, gnunet, 2024/08/25
- [gnunet] 33/39: http3: Add comments; remove unneeded parameters., gnunet, 2024/08/25
- [gnunet] 35/39: http3: Add content-type in POST request., gnunet, 2024/08/25
- [gnunet] 37/39: http3: The client continues to send GET requests., gnunet, 2024/08/25
- [gnunet] 32/39: http3: proper nghttp3/tcp2 detection with automake, gnunet, 2024/08/25
- [gnunet] 38/39: http3: Cancel timer task after the peer finished test., gnunet, 2024/08/25
- [gnunet] 39/39: http3: Use long polling to improve bidirect communication., gnunet, 2024/08/25