Re: TLS-Server with Let’s Encrypt

Sam Varshavchik <[email protected]>
Newsgroups gmane.network.gnutls.general
Message-ID <[email protected]>
Mario Lombardo writes:

> Hi gnutls team,
>
> I’m looking for a way how to use gnutls for a TLS server in combination with  
> Let’s Encrypt. As the validity of those certificates is just a couple of  
> weeks, I would like to replace the current server key by new ones without  
> restarting the server.
>
> The implementation is basically like this:
> // create credstore
> gnutls_certificate_allocate_credentials(&(ctx->tls_x509_cred));
> // load x509 key pair
> gtls_returncode = gnutls_certificate_set_x509_key_file(ctx->tls_x509_cred,  
> ctx->config->cert_bundle, ctx->config->key_file, GNUTLS_X509_FMT_PEM);
> // install signal handler
> signal(SIGUSR1, signal_handler);
>
> Once the signal SIGUSR1 arrives, I would like to re-read x509 stuff.
>
> The only solution I found (yet) is to free the credstore and allocate a new  
> one (then read new keys). This has some downsides, as the server is not  
> working anymore if there is something wrong with the key pair, because I  
> already freed the existing credstore (here ctx->tls_x509_cred). And even

Instead of gnutls_certificate_free_credentials() your old credential store  
first, and then gnutls_certificate_allocate_credentials() a new one and hope  
for the best, why don't you try gnutls_certificate_allocate_credentials()  
first, and if your endeavor succeeds you can free the old one, and replace  
it with the new one.

You are gnutls_certificate_free_credentials() your old credential store  
first, right? Because if this is all what you do, that's shown above, then  
you must be leaking memory.

_______________________________________________
Gnutls-help mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-help
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAABAgAGBQJbY3RGAAoJEGs6Yr4nnb8lvHUQAL/8BPcp1MOeVsNHoaT+FJ1h
ai2nlPGmDjATnVSVSclmYZpHL7z4nckXqTRArw5prcBzacjqoslOic8NARh7fso/
aL3Yvi5Z3Q0NVGWPHfC0Yj07Db8To2SPWHlqWEH0s+QzOA+ak1pEp3xiEEca5kxs
VzE8pwXIACYLrv5p/tAn7tIT4Ry6NzdLf0rHa0K0SDX8V8AHOYEUpzYwHYNzR/Sb
iPxACTwoui/qqxHPx1Qc5ZzqCIz/QkJS3zwp374Ey8GHKXMnrA30U7SPa16FhAFu
rP7LwhEjBYWlnyHtyiaLh5xHrr0H57vFfBav4zN+x8cvHuaz41CYvCM414n7ZFko
aSi5ZB4SAS873PP4h338ZHJ2ZN46gQibPrvYi1eznkxYj96GRsr5xZh5LpU2P+ab
QVPYcaEJ2jv1yAuz5WHYoD5jksRTTq+kZsssd11LsUz1rqgtnboct9Yw0ZGR2+R9
Q0lDzv3vBpEgwK9I1AXWdmSxTqm4tZc1kjRgrDkhoSYcmqi7RnXepbjp/9HYIyBt
EQHJxmqVT5YGvWG49inwXHX9also+D+o7SCdODhq8obCUcK5MN4SByn9HYXDkqta
Dz8RfIgDUoFRKpiRizOfYdrng5b/PwinPCAj3i97x9ibGL0qIBsTOyenyUzrVed8
TBAX0nZh1/KrEK4dhzFN
=QXsn
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.