From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KAkaLdqogmNjxwAAbAwnHQ (envelope-from ) for ; Sun, 27 Nov 2022 01:01:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CD4ZLdqogmO2VQEA9RJhRA (envelope-from ) for ; Sun, 27 Nov 2022 01:01:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1AAD92F4AA for ; Sun, 27 Nov 2022 01:01:30 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oz56X-0002ib-2N; Sat, 26 Nov 2022 19:01:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oz56V-0002iE-N8 for guix-patches@gnu.org; Sat, 26 Nov 2022 19:01:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oz56V-0001sG-Et for guix-patches@gnu.org; Sat, 26 Nov 2022 19:01:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oz56U-0000WQ-9Z for guix-patches@gnu.org; Sat, 26 Nov 2022 19:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59621] [PATCH] services: nginx: Add support for ssl-stapling in server blocks. Resent-From: mirai@makinata.eu Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Nov 2022 00:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59621 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59621@debbugs.gnu.org Cc: Bruno Victal X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16695072551991 (code B ref -1); Sun, 27 Nov 2022 00:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Nov 2022 00:00:55 +0000 Received: from localhost ([127.0.0.1]:41694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz56M-0000W3-Nk for submit@debbugs.gnu.org; Sat, 26 Nov 2022 19:00:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:44694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz56I-0000Vx-AS for submit@debbugs.gnu.org; Sat, 26 Nov 2022 19:00:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oz56G-0002eU-0O for guix-patches@gnu.org; Sat, 26 Nov 2022 19:00:50 -0500 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oz56D-0001kD-Sl for guix-patches@gnu.org; Sat, 26 Nov 2022 19:00:47 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id A9DAB20D4A for ; Sun, 27 Nov 2022 01:00:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 68B6F80097; Sun, 27 Nov 2022 01:00:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id iok6FB1jP8LI; Sun, 27 Nov 2022 01:00:14 +0100 (CET) Received: from guix-nuc.home.arpa (bl12-93-156.dsl.telepac.pt [85.245.93.156]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 595EE80093; Sun, 27 Nov 2022 01:00:14 +0100 (CET) From: mirai@makinata.eu Date: Sat, 26 Nov 2022 23:59:50 +0000 Message-Id: <9a18d0c03940cfe0d8ab01964f12d08fcc972e30.1669507155.git.mirai@makinata.eu> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.107.241; envelope-from=mirai@makinata.eu; helo=smtpmciv5.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669507290; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=nKk3lUVj5C1RLzFPIsnywIp3IBvo01KyCmzMVgb/Wss=; b=q/kZWWT1sz0nvNsXxtUEXXlEfqK/Fxk0+x14t5vCIl7ic0WrCSMSAStYZQq6t6fx72psI5 Dfjk9cuQHwew2KaPRs4SfEmKloETDSoWw420zDgKTKhybIbG7WdLUdAExobYdw+tt43fCv QVHSarbUD8meIxpyir2z0Q4DIzQMCKiYFHR7iRpy5P7drfd2+mGzozxNIPbgcpUhdkkh8F PSsdqEP1JBx2f2rdSPdHj9b/E1AeItJyPWTTd2V4o2qTymmitHnmKCs8fSJ4Pa1eN9szxF sY7X+qoMSNTBA2Dyht5n3xnhVVTQuaL2qOaCIcGqU9mmYZfkxBkdAptTLbpFFQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669507290; a=rsa-sha256; cv=none; b=H76QwNWpzYJBkdo+9VIhV+rI3qAlRhTXu+XH9jt/E39aZ1BCqMRfhY06MBL58a+f9ym23h mdMTqjjA1MMN2OIIVK7D0I0chGHvs36Q1k+GxIPc7e2bywkAm1X4ZnXtAgOp5/hCZXLh46 +0mwv9oRx248ADWZ2pldn1OOXRwdUIGvrmqh1hJAl0bezzBy+tcUZR8UvaCi7xA6qdkMZA HzCEQKzYF2ffLRWL8Po+qtTicpg725EzomD7cSuDF45afLDFPWNx4ZuT4mq5o92IWrJHQe d/3dKYPzVc41lKLuFQ9wDZ1JeNN79aml7I6JzwuYzaI5TIeLlIG+fcebW255IA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.67 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1AAD92F4AA X-Spam-Score: -1.67 X-Migadu-Scanner: scn1.migadu.com X-TUID: NYLcdkbVYxd3 From: Bruno Victal * gnu/services/web.scm (): Add ssl-stapling? and ssl-stapling-verify?. * doc/guix.texi (NGINX): Document this. --- doc/guix.texi | 7 +++++ gnu/services/web.scm | 69 +++++++++++++++++++++++++------------------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index e547d469f4..f116798dba 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -29339,6 +29339,13 @@ you don't have a certificate or you don't want to use HTTPS. Where to find the private key for secure connections. Set it to @code{#f} if you don't have a key or you don't want to use HTTPS. +@item @code{ssl-stapling?} (default: @code{#f}) +Whether the server should @uref{https://datatracker.ietf.org/doc/html/rfc6066#section-8,staple OCSP responses}. +Requires at least one @samp{resolver} directive in @code{raw-content}. + +@item @code{ssl-stapling-verify?} (default: @code{#f}) +Whether the server should verify the OCSP responses. + @item @code{server-tokens?} (default: @code{#f}) Whether the server should add its configuration to response. diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 83aa97055f..8ab4050d47 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -510,48 +510,52 @@ (define httpd-service-type (define-record-type* nginx-server-configuration make-nginx-server-configuration nginx-server-configuration? - (listen nginx-server-configuration-listen - (default '("80" "443 ssl"))) - (server-name nginx-server-configuration-server-name - (default (list 'default))) - (root nginx-server-configuration-root - (default "/srv/http")) - (locations nginx-server-configuration-locations - (default '())) - (index nginx-server-configuration-index - (default (list "index.html"))) - (try-files nginx-server-configuration-try-files - (default '())) - (ssl-certificate nginx-server-configuration-ssl-certificate - (default #f)) - (ssl-certificate-key nginx-server-configuration-ssl-certificate-key - (default #f)) - (server-tokens? nginx-server-configuration-server-tokens? - (default #f)) - (raw-content nginx-server-configuration-raw-content - (default '()))) + (listen nginx-server-configuration-listen + (default '("80" "443 ssl"))) + (server-name nginx-server-configuration-server-name + (default (list 'default))) + (root nginx-server-configuration-root + (default "/srv/http")) + (locations nginx-server-configuration-locations + (default '())) + (index nginx-server-configuration-index + (default (list "index.html"))) + (try-files nginx-server-configuration-try-files + (default '())) + (ssl-certificate nginx-server-configuration-ssl-certificate + (default #f)) + (ssl-certificate-key nginx-server-configuration-ssl-certificate-key + (default #f)) + (ssl-stapling? nginx-server-configuration-ssl-stapling? + (default #f)) + (ssl-stapling-verify? nginx-server-configuration-ssl-stapling-verify? + (default #f)) + (server-tokens? nginx-server-configuration-server-tokens? + (default #f)) + (raw-content nginx-server-configuration-raw-content + (default '()))) (define-record-type* nginx-upstream-configuration make-nginx-upstream-configuration nginx-upstream-configuration? - (name nginx-upstream-configuration-name) - (servers nginx-upstream-configuration-servers) - (extra-content nginx-upstream-configuration-extra-content - (default '()))) + (name nginx-upstream-configuration-name) + (servers nginx-upstream-configuration-servers) + (extra-content nginx-upstream-configuration-extra-content + (default '()))) (define-record-type* nginx-location-configuration make-nginx-location-configuration nginx-location-configuration? - (uri nginx-location-configuration-uri - (default #f)) - (body nginx-location-configuration-body)) + (uri nginx-location-configuration-uri + (default #f)) + (body nginx-location-configuration-body)) (define-record-type* nginx-named-location-configuration make-nginx-named-location-configuration nginx-named-location-configuration? - (name nginx-named-location-configuration-name - (default #f)) - (body nginx-named-location-configuration-body)) + (name nginx-named-location-configuration-name + (default #f)) + (body nginx-named-location-configuration-body)) (define-record-type* nginx-configuration make-nginx-configuration @@ -628,6 +632,9 @@ (define (emit-nginx-server-config server) (ssl-certificate (nginx-server-configuration-ssl-certificate server)) (ssl-certificate-key (nginx-server-configuration-ssl-certificate-key server)) + (ssl-stapling? (nginx-server-configuration-ssl-stapling? server)) + (ssl-stapling-verify? + (nginx-server-configuration-ssl-stapling-verify? server)) (root (nginx-server-configuration-root server)) (index (nginx-server-configuration-index server)) (try-files (nginx-server-configuration-try-files server)) @@ -647,6 +654,8 @@ (define-syntax-rule (and/l x tail ...) " server_name " (config-domain-strings server-name) ";\n" (and/l ssl-certificate " ssl_certificate " <> ";\n") (and/l ssl-certificate-key " ssl_certificate_key " <> ";\n") + " ssl_stapling " (if ssl-stapling? "on" "off") ";\n" + " ssl_stapling_verify " (if ssl-stapling-verify? "on" "off") ";\n" (if (not (equal? "" root)) (list " root " root ";\n") "") base-commit: 68925b5ee7e0d96b0c84ae98a633eea5097bf511 -- 2.38.1