Caddy

開源的,原生支持 HTTP/2 的 Web 服務器

Caddy服務器(或稱Caddy Web)是一個開源的,使用 Golang 編寫,支持 HTTP/2 的 Web 服務端。它使用 Golang 標準庫提供 HTTP 功能。

Caddy
原作者Matthew Holt
首次發布2015年4月28日,​9年前​(2015-04-28
當前版本
  • 2.7.6 (2023年12月8日;穩定版本)[1]
編輯維基數據鏈接
源代碼庫 編輯維基數據鏈接
編程語言Go
操作系統AndroidBSD variantsLinuxOS XWindows
類型Web服務器, 反向代理服務器
許可協議Apache許可證2.0
網站官方網站 在維基數據上編輯此內容

Caddy 一個顯著的特性是默認啟用 HTTPS[2][3]它是第一個無需額外配置即可提供 HTTPS 特性的 Web 服務器。[4]

作者 Matt Holt 於 2014 年 12 月開始開發 Caddy ,並於 2015 年 4 月發布第一個版本。[5] 在發布後的一年裡,它的下載量超過了 20000 次,並在 GitHub 上獲得了 4500 個 Star。[6]

Caddy 支持各種 Web 技術,提供靜態編譯的二進制文件,支持 i386amd64ARM 架構上的 WindowsMacLinuxAndroidBSD 操作系統。

功能 編輯

Caddy 可以提供各種網站技術,它也可以作為反向代理和負載均衡器。Caddy 的大部分功能都以中間件的形式實現,並通過 Caddyfile 中的指令(用於配置 Caddy 的文本文件)進行控制。[7]

安全 編輯

Caddy 免於很多已知的 CVEs 攻擊 (包括 Heartbleed, DROWN, POODLE, 和 BEAST[12],另外, Caddy 使用 TLS_FALLBACK_SCSV 以防止協議降級攻擊。

2015 年 6 月 2 日,版本 0.7.1 修復了 Caddy 簡單服務器鑒權中間件中時間欺詐攻擊的漏洞。[13]

關於協議和密碼套件,Caddy 使用 TLS 1.0-1.2,並且傾向於 ECDHE ECDSA 與 AES256-GCM-SHA384,支持十幾種不同的加密方式。Cloudflare 已經使用了 Caddy 作為 TLS 1.3 的實現方案。[14]

傳統的特權降級無法工作在 Golang 程序上。[15] 為了綁定低於 1024 的端口, Caddy 必須使用 root 賬戶運行 (不建議) 或通過 setcap 給予低位端口使用權限 (建議的) 。 並且,在將來的版本中會嘗試使用非特級子進程運行。[16]

Caddy 沒有自動啟動 HTTP Strict Transport Security,推薦通過 Caddy 的 header 配置啟用 HSTS。[17]

自動簽發 HTTPS 編輯

Caddy 默認通過檢查域名來啟用 HTTPS (通過 ACME protocol 檢查域名並簽發證書), 並且重定向 HTTP 請求到 HTTPS。[18] 它在啟動期間根據需要簽發證書,並在服務器的使用期間自動重簽發。 Let's Encrypt 是默認的證書頒發機構,但用戶可以自定義所使用的 ACME CA,這在測試配置時是必要的。在 2016 年第一季度, 有百分之二的 Let's Encrypt 證書是由 Caddy 簽發的。

一個可選的配置允許 Caddy 在需要時簽發一個證書 "按需 TLS"[19] 使用這種方案時,用戶必須指定可通過該方案配置的證書數量。 當 Caddy 收到一個沒有配置證書的請求時, 它會自動通過 ACME 簽發並配置, 然後將證書存儲於內存和硬盤。 這個過程通常需要幾秒鐘的時間,並且受到限制。

當使用 TLS, Caddy 會自動切換會話密鑰以保證安全性。[20]

參考資料 編輯

  1. ^ Release v2.7.6. 2023年12月13日 [2023年12月8日]. 
  2. ^ Johnson, Brad. A Better Web Server with Free SSL. 23 February 2016 [5 March 2016]. (原始內容存檔於2017-08-02). 
  3. ^ Automatic HTTPS with Caddy Server. 18 December 2015 [5 March 2016]. (原始內容存檔於2017-08-02). 
  4. ^ Dmitry Chestnykh [@dchest]. Caddy is the first general-purpose web server to default to HTTPS without user intervention (using Let's Encrypt) (推文). 17 December 2015 –透過Twitter. 
  5. ^ Show HN: Caddy, a cross-platform HTTP/2 web server. 28 April 2015 [2017-04-03]. (原始內容存檔於2017-04-22). 
  6. ^ Is Caddy Free?. [2017-04-03]. (原始內容存檔於2017-04-22). 
  7. ^ The Caddyfile. [29 February 2016]. (原始內容存檔於2017-04-20). 
  8. ^ tls - Caddy Directives. [8 March 2016]. (原始內容存檔於2017-03-17). 
  9. ^ Benedetti, Benoit. Caddy, Le Serveur Web Facile [Caddy, The Easy Web Server]. GNU/Linux Magazine France (France). November 2015 (法語). 
  10. ^ How to Setup the Caddy Web Server with php-fpm. [2017-04-03]. (原始內容存檔於2017-08-18). 
  11. ^ Beke, Mathias. Caddy Server and WordPress (PHP-FPM). 21 August 2015 [2017-04-03]. (原始內容存檔於2016-05-03). 
  12. ^ SSL Server Test: caddyserver.com (Powered by Qualys SSL Labs). [5 March 2016]. (原始內容存檔於2021-04-10). 
  13. ^ Release 0.7.1 · mholt/caddy. 2 June 2015 [2017-04-03]. (原始內容存檔於2019-02-15). 
  14. ^ Nick Sullivan [@grittygrease]. It's built in Go using custom versions @rlbarnes's Mint and @mholt6's Caddy (推文). 4 Mar 2016 –透過Twitter. 
  15. ^ syscall: Setuid/Setgid doesn't apply to all threads on Linux. 21 January 2011 [5 March 2016]. (原始內容存檔於2018-02-07). 
  16. ^ Implement privilege de-escalation. 21 January 2016 [2017-04-03]. (原始內容存檔於2017-04-22). 
  17. ^ HTTP Strict Transport Security. [8 March 2016]. (原始內容存檔於2017-04-26). 
  18. ^ Automatic HTTPS. [5 March 2016]. (原始內容存檔於2017-03-17). 
  19. ^ On-Demand TLS. [5 March 2016]. (原始內容存檔於2017-03-17). 
  20. ^ Springall, Drew; Durumeric, Zakir; Halderman, J. Alex. Measuring the Security Harm of TLS Crypto Shortcuts. Proceedings of the 2016 ACM on Internet Measurement Conference. IMC '16 (New York, NY, USA: ACM). 2016-01-01: 33–47. ISBN 9781450345262. doi:10.1145/2987443.2987480. 

外部連結 編輯