[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 30/39: http3: Autogenerate certificate when there is no certifi
From: |
gnunet |
Subject: |
[gnunet] 30/39: http3: Autogenerate certificate when there is no certificate in the configuration file. |
Date: |
Sun, 25 Aug 2024 15:16:26 +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 9e8c81abb04ae363b9d475e80b8bb8b9f9c9e877
Author: Shichao <mrrr61@outlook.com>
AuthorDate: Tue Jul 30 12:07:06 2024 +0800
http3: Autogenerate certificate when there is no certificate in the
configuration file.
---
src/service/transport/gnunet-communicator-http3.c | 58 +++++++++++++++--------
1 file changed, 38 insertions(+), 20 deletions(-)
diff --git a/src/service/transport/gnunet-communicator-http3.c
b/src/service/transport/gnunet-communicator-http3.c
index cdf8c4b15..3b0ba227e 100644
--- a/src/service/transport/gnunet-communicator-http3.c
+++ b/src/service/transport/gnunet-communicator-http3.c
@@ -3188,28 +3188,46 @@ run (void *cls,
return;
}
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_filename (cfg,
- COMMUNICATOR_CONFIG_SECTION,
- "KEY_FILE",
- &key_file))
+ key_file = NULL;
+ cert_file = NULL;
+ if ((GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ COMMUNICATOR_CONFIG_SECTION,
+ "KEY_FILE",
+ &key_file)) ||
+ (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,
- "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_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Creating new certificate\n");
GNUNET_free (key_file);
- return;
+ GNUNET_free (cert_file);
+ key_file = GNUNET_strdup("https.key");
+ cert_file = GNUNET_strdup("https.crt");
+
+ struct GNUNET_OS_Process *cert_creation;
+
+ cert_creation = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ NULL, NULL, NULL,
+
"gnunet-transport-certificate-creation",
+
"gnunet-transport-certificate-creation",
+ key_file,
+ cert_file,
+ NULL);
+ if (NULL == cert_creation)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Can't create new certificate\n");
+ GNUNET_free (key_file);
+ GNUNET_free (cert_file);
+
+ return;
+ }
+ GNUNET_OS_process_wait (cert_creation);
+ GNUNET_OS_process_destroy (cert_creation);
}
disable_v6 = GNUNET_NO;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 09/39: http3: add http3 test, (continued)
- [gnunet] 09/39: http3: add http3 test, gnunet, 2024/08/25
- [gnunet] 10/39: http3: fix the log of ngtcp2_conn_writev_stream, gnunet, 2024/08/25
- [gnunet] 13/39: http3: extend flow control window, now can pass basic test., gnunet, 2024/08/25
- [gnunet] 22/39: http3: Complete the callbacks of nghttp3 and ngtcp2, gnunet, 2024/08/25
- [gnunet] 25/39: http3: make meson compie; remove application handle, gnunet, 2024/08/25
- [gnunet] 20/39: http3: Handle errors and refactor the code for receiving packets, gnunet, 2024/08/25
- [gnunet] 26/39: http3: better http3 detection logic, gnunet, 2024/08/25
- [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 <=
- [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, 2024/08/25
- [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