ðŸ Archived View for geminiprotocol.net ⺠docs ⺠ja ⺠protocol-specification.gmi captured on 2024-07-08 at 23:58:51. Gemini links have been rewritten to link to archived content
â¡ïž Next capture (2024-08-18)
-=-=-=-=-=-=-
ããŒãžã§ã³0.24.0
æ¬ææžã¯ä»¥äžã®æ¡é ã®äžã«ãããªãã¯ãã¡ã€ã³ã«çœ®ãããŸãã
Creative Commons CC0 1.0 Universal Public Domain Dedication
æ¬ææžã¯ãã¡ã€ã«è»¢éã®ããã®Geminiãããã³ã«ãèŠå®ããŸããHTTP [RFC7230] ã®åãèœãšããšããããGopher [RFC1436] ã®çŽ¯ç©çãªæ¹åãšèŠãããšãã§ããŸããTCP [STD7] ã®ããŒãçªå·1965äžã§èµ°ããTLS [RFC8446] ãæäŸããæå·åã䌎ãåçŽãªèŠæ±ãšå¿çã®ãã©ã³ã¶ã¯ã·ã§ã³ã§ããæå®ã®MIMEçš®å¥ [RFC2045] ä»ãã§ä»»æã®ããžã¿ã«å 容ãéããŸãããæããã䜿ãããŠãã軜éãã€ããŒããã¹ãææžããããé¢é£ããŠåå¥ã«èŠå®ãã圢åŒã䜿ãããŸãã
Geminiãã€ããŒããã¹ã圢åŒïŒå¥åãgemtextãïŒã®ä»æ§ãåç §
æ¬ææžäžã®ããŒã¯ãŒããããªããã°ãªããªã (MUST)ããããŠã¯ãªããªã (MUST NOT)ããå¿ é ã§ãã (REQUIRED)ããããããšã«ãªã£ãŠãã (SHALL)ããããªãããšã«ãªã£ãŠãã (SHALL NOT)ãããã¹ã (SHOULD)ãããã¹ãã§ãªã (SHOULD NOT)ããæšå¥šãã (RECOMMENDED)ããããŠããã (MAY)ããçç¥ã§ãã (OPTIONAL)ã㯠[BCP14] äžã«èšèŒãããŠããããã«è§£éãããŸãã
Geminiã®æéèŠã®ç®æšã¯å®è£ ã容æïŒ1æ¥2æ¥ãæããã°ããããæ°çŸè¡ã§ãµãŒããŒãã¯ã©ã€ã¢ã³ããã§ããïŒã§ããã€ã€ãæçšãªåçŽãªæç¶ããæäŸããããšã§ãã
Geminiã§éãå±ããäžã§ãTCPäžã®æ¢å®ã§ã¯ããŒãçªå·1965äžã§ïŒæåã®æ人ã®Geminiããã·ã§ã³ã§ããGemini 3ã¯1965幎3æã«é£è¡ããŸããïŒãæå·åããããã©ã³ã¶ã¯ã·ã§ã³ãæäŸããããã«TLSã䜿ããŸãããµãŒããŒãšã¯ã©ã€ã¢ã³ãã¯TLS 1.2以äžã«å¯Ÿå¿ããªããã°ãªããŸããã䜿çšãããTLS蚌ææžã®çš®é¡ïŒCAããŒã¹ãªããèªå·±æžåïŒã¯ãŸã è°è«äžã®ããããã¹ããã©ã¯ãã£ã¹ãææžã«èŠå®ãããŸããæ¢å®ã®ããŒãçªå·1965ã¯ãã¹ãã·ã¹ãã ã§éç¹æš©ããŒãã§ããããµãŒãã¹ãèµ°ãããäžã§ç®¡çè ã¢ã«ãŠã³ãã®äœ¿çšã¯å¿ èŠãããŸããã
Geminiã®ã¢ãã¬ã¹ã¯URI [STD66] ã«åºã¥ãã以äžã®å€æŽç¹ããããŸãã
1. 䜿ãããã¹ããŒã ã¯ãgeminiãã§ã
2. URIã®å©çšè æ å ±ã®éšåã¯äœ¿ã£ãŠã¯ãªããŸãã
3. 空ãã¹æ§æèŠçŽ ãšã/ãã®ãã¹æ§æèŠçŽ ã¯ç䟡ã§ããµãŒããŒã¯äž¡æ¹ããªãã€ã¬ã¯ãã«éãããšãªã察å¿ããªããã°ãªããŸããã
4. æå®ãããªããã°ããŒãçªå·ã¯æ¢å®ã§1965ã§ãã
5. èªå¯ç¯ã§ã®IPã¢ãã¬ã¹ã®äœ¿çšã¯ã䜿ãããã¹ãã§ã¯ãããŸããã
æ¬ææžã¯ã¯ã©ã€ã¢ã³ããšãµãŒããŒãããªããã°ãããªãããšãè² èšãããããã³ã«ãæŒãããã®ã¿ã§ãããäžæ žãããã³ã«ã®å€åŽã®ä»æ§ã«ããããã§ã¯æŒãããããŠããªãGeminiã®å¥ã®åŽé¢ããããŸããã¯ã©ã€ã¢ã³ããšãµãŒããŒäž¡æ¹ã®å®è£ è ã¯Geminiãããã³ã«ã®ãã¹ããã©ã¯ãã£ã¹ã®æåŒãã«åŸãããšãæšå¥šãããŸãã
ã¯ã©ã€ã¢ã³ãã¯ãµãŒããŒã«æ¥ç¶ãèŠæ±ãéããŸããèŠæ±ã¯çµ¶å¯ŸURIã«CRïŒæå13ïŒãšLFïŒæå10ïŒãç¶ãããã®ãããªããŸãããããæ¡åŒµBNF [STD68] ã§è¡šããšä»¥äžã«ãªããŸãã
request = absolute-URI CRLF ; absolute-URI㯠[STD66] ãã ; CRLF㯠[STD68] ãã
èŠæ±ãäœããšããURIã¯1024ãã€ããè¶ ããŠã¯ãªããŸããããŸããµãŒããŒã¯URIããã®å¶éãè¶ ããèŠæ±ãæ絶ããªããã°ãªããŸããããµãŒããŒã¯å©çšè æ å ±ä»ãã®èŠæ±ãæ絶ããªããã°ãªããŸãããã¯ã©ã€ã¢ã³ãã¯èŠæ±ã®äžéšãšããŠãã©ã°ã¡ã³ããéã£ãŠã¯ãªããŸããããµãŒããŒã¯ãã®ãããªèŠæ±ãåæ§ã«æ絶ããªããã°ãªããŸãããã¯ã©ã€ã¢ã³ãã空ãã¹ã§èŠæ±ãäœããšããã¯ã©ã€ã¢ã³ãã¯èŠæ±ã®æ«å°Ÿã«ã/ããå ããã¹ãã§ããããããµãŒããŒã¯ç©ºã®ãã¹ãæ±ããªããã°ãªããŸããã
èŠæ±ããã£ããšãããµãŒããŒã¯ç¶æ ãšãèŠæ±ãæåããå Žåã¯ã¯ã©ã€ã¢ã³ããèŠæ±ããå 容ãéãè¿ãããšã«ãªããŸããç¶æ ã¯2æ¡ã®å¿çã³ãŒãããããïŒéãããå¿ç次第ã§ïŒCRãšLFã«ç¶ããŠè¿œå æ å ±ãä»ããããŸããæ¡åŒµBNFã§ã¯ä»¥äžã®éãã§ãã
reply = input / success / redirect / tempfail / permfail / auth input = "1" DIGIT SP prompt CRLF success = "2" DIGIT SP mimetype CRLF body redirect = "3" DIGIT SP URI-reference CRLF ; è£è¶³ïŒ[STD66] 㯠ãã ãæå¹ãªURIåç §ãšããŠèš±ããŠããŸãã ; ãããããã¯ãªãã€ã¬ã¯ãã®å Žåã«ã¯æå¹ãšãããŸããã tempfail = "4" DIGIT [SP errormsg] CRLF permfail = "5" DIGIT [SP errormsg] CRLF auth = "6" DIGIT [SP errormsg] CRLF prompt = 1*(SP / VCHAR) mimetype = type "/" subtype *(";" parameter) errormsg = 1*(SP / VCHAR) body = *OCTET VCHAR =/ UTF8-2v / UTF8-3 / UTF8-4 UTF8-2v = %xC2 %xA0-BF UTF8-tail ; C1å¶åŸ¡éåã¯ãããŸãã / %xC3-DF UTF8-tail ; URI-referenceã¯[STD66]ãã ; ; type ã¯[RFC2045]ãã ; subtype ã¯[RFC2045]ãã ; parameter ã¯[RFC2045]ãã ; ; CRLF ã¯[STD68]ãã ; DIGIT ã¯[STD68]ãã ; SP ã¯[STD68]ãã ; VCHAR ã¯[STD68]ãã ; OCTET ã¯[STD68]ãã ; WSP ã¯[STD68]ãã ; ; UTF8-3 ã¯[STD63]ãã ; UTF8-4 ã¯[STD63]ãã ; UTF8-tail ã¯[STD63]ãã
[STD68]ã®VCHARèŠåã¯ãŠãã³ãŒãã®éå¶åŸ¡ã³ãŒããã€ã³ããå«ããã¹ãæ¡åŒµãããŸãïŒãŸãUTF-8 [STD63] ã§ç¬Šå·åãããŸãïŒãæ¬æã®çš®é¡ã¯ããã§ã¯æå®ãããŸããããããã¯å 容ãéãå±ããããå 容ã®MIMEçš®å¥ã«ããããã§ããå®äºã®å¿çïŒå 容ãå«ããããŸãïŒãéãã«ããã£ãŠããµãŒããŒã¯æ¥ç¶ãéããŸãããã®ãšãTLSã®close_notifyã®ä»çµã¿ã䜿ã£ãŠããã以äžããŒã¿ã¯éãããªãããšãã¯ã©ã€ã¢ã³ãã«äŒããªããã°ãªããŸããã
ç¶æ å€ã¯10ãã69ã®ç¯å²ã«ããã䞡端ãå«ã¿ãŸãããã ãçŸåšå šãŠã®å€ãå®çŸ©ãããŠã¯ããŸãããã¯ã©ã€ã¢ã³ãã1æ¡ç®ã䜿ã£ãŠå¿çãæ±ã£ãŠãããããã«ã°ã«ãŒãåãããŠããŸããã2æ¡ç®ã¯ç¶æ ãæŽã«æããã«ããããã«ãããã¯ã©ã€ã¢ã³ãã¯äœããã¹ãã決ããéã«è¿œå ã®æ¡ã䜿ãããšãæšå¥šãããŸãããµãŒããŒã¯å®çŸ©ãããŠããªãç¶æ ã³ãŒããéã£ãŠã¯ãªããŸããã
6ã°ã«ãŒãã®ç¶æ ã³ãŒãããããŸãã
ã¯ã©ã€ã¢ã³ãã¯ã10ãããå°ãããã69ããã倧ããç¶æ ã³ãŒããæ絶ããå©çšè ã«ãã®ããšãèŠåããªããã°ãªããŸãããã¯ã©ã€ã¢ã³ãã¯ã10ãããã69ãã®éã®æªå®çŸ©ç¶æ ã³ãŒãã1ãããç®ã®æ¢å®ã®åäœã«ããæ±ãã¹ãã§ãããã®ããã14ãç¶æ ã§ã¯ããããã¯ã©ã€ã¢ã³ããã10ããåãåã£ããã®ããã«åäœããã¹ãã§ããç¶æ ã22ãã§ã¯ã¯ã©ã€ã¢ã³ããããããã20ããåãåã£ããã®ããã«åäœããã¹ãã§ãã
ãµãŒããŒã¯ã¯ã©ã€ã¢ã³ãã®å©çšè ã®å ¥åãåŸ ã£ãŠããŸããç¶æ ã³ãŒãã®åŸã«éãããè¿œå æ å ±ã¯ããã¹ãã§ãããã¯ã©ã€ã¢ã³ãã¯å©çšè ã«æ å ±ãæ±ããã¹ãããã³ãããåºããšãã«äœ¿ããªããã°ãªããŸããããŸããã®æ å ±ã¯åãåããéšåãšããŠåãURIã«éãè¿ãããŸãã空çœã¯ã%20ãã«ç¬Šå·åãããªããã°ãªããŸãããã¯ã©ã€ã¢ã³ãã¯è€æ°è¡ãããªãå ¥åé ç®ãåããŠãæ§ããŸããããŸããã®å Žåã«æ¹è¡ã¯ã%0AããšããŠç¬Šå·åãããã¹ãã§ãããµãŒããŒã¯ã%0Aããšã%0D%0Aãã®äž¡æ¹ãæ¹è¡ãšããŠèªèãã¹ãã§ããçŸåšãã®åé¡ã«ã¯2ã€ã®ç¶æ ã³ãŒããå®çŸ©ãããŠããŸãã
input = "1" DIGIT SP prompt CRLF prompt = 1*(SP / VCHAR)
ã¯ã©ã€ã¢ã³ããæ¢ã«åãåããæååãå«ãURIã§1xã®å¿çãåãåã£ããšãã¯ãã¯ã©ã€ã¢ã³ãã¯åãåããæååãå©çšè ã®å ¥åã§çœ®ãæããªããã°ãªããŸãããäŸãã°äžããããURIã®çµæã次ã®ããã«å¿ç10ã§ãã£ããšããŸãã
gemini://example.net/search?hello
ã¯ã©ã€ã¢ã³ãã¯æ¬¡ã®èŠæ±ãéããŸãã
gemini://example.net/search?the%20user%20input
åºæ¬ã®å ¥åç¶æ ã³ãŒãã§ããã¯ã©ã€ã¢ã³ãã¯å©çšè ã«å ¥åã®ããã³ãããåºããªããã°ãªããŸãããå ¥å㯠[STD66] ã«ããURI笊å·åããŠãã®å¿çãçæããåãURIã«åãåãããšããŠéãã¹ãã§ãã
ç¶æ ã³ãŒã10ã«åŸããŸããããã¹ã¯ãŒãã®ãããªæ©å¯æ§ã®ããå ¥åã«äœ¿çšããŸããã¯ã©ã€ã¢ã³ãã¯ç¶æ ã³ãŒã10ã«åŸã£ãŠè³ªåã衚瀺ãã¹ãã§ãããå©çšè ã®å ¥åã¯ãè©è¶ãã«èŠããŠãèªã¿åãããããšãé²ãããã«ãç»é¢ã«è¡šç€ºãã¹ãã§ã¯ãããŸããã
èŠæ±ãæ±ãããµãŒããŒã¯ã¯ã©ã€ã¢ã³ãã«å 容ãéããŸãããè¿œå æ å ±ã¯å 容ã®MIMEçš®å¥ã§ [RFC2045] ã«ããæå®ãããŸããã¯ã©ã€ã¢ã³ãã¯ç解ã§ããªãMIMEä»®åŒæ°ãåã«ç¡èŠããŠæ±ããªããã°ãªããŸããã
å¿çæ¬æã¯åãªãçã®å 容ã§ãããgopher [RFC1436] ããããããã¹ããªãããã€ããªã§ããå§çž®ãæçåãå 容ã転éã®ç¬Šå·åãšãã£ãé¡ã®å¯Ÿå¿ã¯ãããŸããããµãŒããŒã¯æçµãã€ãã®åŸã«æ¥ç¶ãéãããå¿çæ«å°Ÿãä¿¡å·ã¯ãããŸããã
ã€ã³ã¿ãŒãããã¡ãã£ã¢çš®å¥ã¯æ£çµ±ãªåœ¢åŒã§ç»é²ãããŸããGeminiãä»ããŠè»¢éãããå 容ã¯è»¢éã«å ç«ã£ãŠé©åäžã€æ£çµ±ãªåœ¢åŒã§è¡šçŸãããªããã°ãªããŸããããã ã次ã®æ®µèœã§å®çŸ©ãããããã«ãtextãçš®å¥ã¯äŸå€ã§ãã
æ£çµ±ãªåœ¢åŒã«ãããŠããtextãã®ã¡ãã£ã¢å¯çš®å¥ã¯ããã¹ãè¡ã®æ¹è¡ãšããŠCRLFã䜿ããŸããGeminiã¯ãã®èŠä»¶ãç·©åããåã«LFåç¬ã®ããã¹ãã¡ãã£ã¢ã®è»¢éãèš±ããŸãïŒãã ãCRåç¬ã¯èš±ããŸããïŒãããã¯å¿çæ¬æå šäœã§äžè²«æ§ãæã£ãŠæ¹è¡ãããŠããããšãè¡šçŸããŸããGeminiã®ã¯ã©ã€ã¢ã³ãã¯Geminiãä»ããŠåãåã£ãããã¹ãã¡ãã£ã¢äžã®CRLFãšLFãæ¹è¡ã®è¡šçŸãšããŠåãä»ããªããã°ãªããŸããã
ã¯ã©ã€ã¢ã³ãã¯ãæåéåãUTF-8ã®text/geminiãšïŒæ§é çã«UTF-8ã®éšåéåã§ããïŒUS-ASCII [STD80] ãªããUTF-8ã®æåéåã®text/plainã®MIMEçš®å¥ã«å¯Ÿå¿ããªããã°ãªããŸãããã¯ã©ã€ã¢ã³ãã¯ä»ã®æåéåã®text/plainã«å¯Ÿå¿ããŠãæ§ããŸãããæå®ãããæåéåãªãã«text/*ã®MIMEçš®å¥ã瀺ãããŠãããšããã¯ã©ã€ã¢ã³ãã¯æåéåãUTF-8ãšä»®å®ãã¹ãã§ãããã£ã¹ã¯ã«ä¿åããããã®ã§ãã£ãããä»ã®ããã°ã©ã ã«æž¡ããããã®ã§ãã£ããããŠããã¯ã©ã€ã¢ã³ãã¯ä»ã®MIMEçš®å¥ãæ±ãã¹ãã§ãã
text/geminiã®ä»æ§ã¯text/geminiã®ä»æ§ã§äžããããŸãã
ãã®åé¡ã«å®çŸ©ãããç¶æ ã¯20ã ãã§ãã
success = "2" DIGIT SP mimetype CRLF body mimetype = type "/" subtype *(";" parameter) body = *OCTET
ãµãŒããŒã¯æ£åžžã«è§£æããŠèŠæ±ãç解ããäžããããMIMEçš®å¥ã®å 容ãéãå±ããŸãã
ãµãŒããŒã¯ã¯ã©ã€ã¢ã³ãã«å 容ãããæ°ããå ŽæãéããŸããè¿œå æ å ±ã¯çµ¶å¯ŸURIãŸãã¯çžå¯ŸURIã§ãããµãŒããŒãåãåããæååä»ãã®èŠæ±ã«å¯ŸããŠå¿çã§ãªãã€ã¬ã¯ããéã£ããšããã¯ã©ã€ã¢ã³ãã¯åãåããæååãæ°ããå Žæã«é©çšããŠã¯ãªããŸãããåãåããæååãæ°ããå Žæã«éèŠã§ããã°ããµãŒããŒã¯åãåããããªãã€ã¬ã¯ãã®äžéšãšããŠå«ããŠãæ§ããŸããããµãŒããŒã¯ãªãã€ã¬ã¯ãã«ãã©ã°ã¡ã³ããå«ããã¹ãã§ã¯ãããŸãããããããããäžããããŠãããšãããã€ã¯ã©ã€ã¢ã³ãã«ïŒå ã®URIããïŒé©çšã§ãããã©ã°ã¡ã³ãããããšããã©ã¡ãã®ãã©ã°ã¡ã³ããé©çšãããã¯ã¯ã©ã€ã¢ã³ãã«å§ããããŸããã¯ã©ã€ã¢ã³ãã¯åŸããªãã€ã¬ã¯ãã®æ°ã5åã«å¶éããªããã°ãªããŸããããã®åé¡ã«ã¯2ã€ã®å®çŸ©ãããã³ãŒãããããŸãã
redirect = "3" DIGIT SP URI-reference CRLF ; è£è¶³ïŒRFC-3987/3987ã§ã¯ãããæå¹ãªURIåç §ã«ã§ããŸãã ; ãããããã¯ãªãã€ã¬ã¯ãã®å Žåã«æå¹ã§ããããšãæå³ããŸããã
åºæ¬ã®ãªãã€ã¬ã¯ãã³ãŒãããªãã€ã¬ã¯ãã¯äžæçã§ã¯ã©ã€ã¢ã³ãã¯å ã®URIã§å 容ãèŠæ±ãç¶ããã¹ãã§ãã
å 容ã®äœçœ®ã¯æ°žç¶çã«æ°ããå Žæã«ç§»ããŸãããã¯ã©ã€ã¢ã³ãã¯ä»¥åŸãäžããããå 容ãååŸããããã«æ°ããå Žæã䜿ãã¹ãã§ãã
èŠæ±ã倱æããŸãããå¿çæ¬æã¯ãããŸããã倱æã®æ§è³ªã¯äžæçãªãã®ã§ããã€ãŸãå°æ¥çã«åäžã®èŠæ±ã¯æåããå¯èœæ§ããããŸããçç¥å¯èœãªæèšã§å€±æã®è¿œå æ å ±ãæäŸããŠæ§ããŸãããããããããªãã¯ã©ã€ã¢ã³ãã¯äººéã®å©çšè ã«è¡šç€ºãã¹ãã§ãããã®åé¡ã®äžã«ã¯5ã€ã®ç¶æ ã³ãŒãããããŸãã
tempfail = "4" DIGIT [SP errormsg] CRLF errormsg = 1*(SP / VCHAR)
ãµãŒããŒã«èŠå®ãããŠããªãæ¡ä»¶ãååšããéãå±ããããšã¯ããããå 容ã§ãããã®ã®ãã¯ã©ã€ã¢ã³ãã¯æ¹ããŠå 容ã®ç²åŸãè©Šã¿ãããšãã§ããŸãã
ãªãŒããŒããŒãããµãŒããŒã®ä¿å®äœæ¥ã®ããå©çšã§ããŸããïŒHTTP 503ãšé¢é£ïŒã
CGIãããã«äŒŒãåçãªå 容ãçæããã·ã¹ãã ã®åŠçãäºæããç°åžžçµäºãããæéåãã«ãªã£ããããŸããã
ãµãŒããŒãæ£åžžã«ãªã¢ãŒããã¹ããšã®ãã©ã³ã¶ã¯ã·ã§ã³ãå®äºã§ããªãã£ãããããããã·ã®èŠæ±ã倱æããŸããïŒHTTP 502ã504ãšé¢é£ïŒã
ãµãŒããŒã¯ã¯ã©ã€ã¢ã³ãã«èŠæ±ã倱éãããããèŠæ±ããŠãããææ°çããã¯ãªãã䜿ãã¹ãã§ããèŠæ±ã®åéã®é£ç¶ããé 延ã¯ãã®ç¶æ ãè¿ãããªããªããŸã§äºåãããŸãã
èŠæ±ã倱æããŸãããå¿çæ¬æã¯ãããŸããã倱æã®æ§è³ªã¯æ°žä¹ ã§ãã£ãŠããã®å 容ãžã®æŽãªãèŠæ±ã«ã¯åãç¶æ ãè¿ãããã¯ã©ã€ã¢ã³ãã¯åãèŠæ±ãããã¹ãã§ã¯ãããŸãããçç¥ã§ããäŒæã§å€±æã«ã€ããŠã®è¿œå æ å ±ãæäŸããŠãè¯ãããã®æ å ±ããããšãã¯ã¯ã©ã€ã¢ã³ãã¯å©çšè ã«è¡šç€ºãã¹ãã§ãããã®åé¡ã«ã¯5ã€ã®ç¶æ ã³ãŒãããããŸãã
permfail = "5" DIGIT [SP errormsg] CRLF errormsg = 1*(SP / VCHAR)
ããã¯æ±çšã®æ°žç¶çãªå€±æã³ãŒãã§ãã
èŠæ±ãããè³æºã¯èŠã€ãããïŒãšãªã¢51ã§ã¯äœãèŠã€ãããŸããïŒãã以äžã®æ å ±ã¯ãããŸãããå°æ¥ã¯ååšãããããããŸããããããã§ãªããããããŸããã誰ãåããã§ããããã
èŠæ±ãããè³æºã¯ææ©å ¥æã§ããåã³æã«å ¥ãããšããããŸãããæ€çŽ¢ãšã³ãžã³ãé¡ããããŒã«ã¯ãã®è³æºã玢åŒããåé€ãã¹ãã§ããå 容åéåšã¯è³æºã®èŠæ±ãæ¢ããŠäººéã®å©çšè ã«è³ŒèªããŠããè³æºãæ£éžããããšãäŒããã¹ãã§ãïŒHTTP 410ãé¢é£ïŒã
ãã¡ã€ã³ã®è³æºãžã®èŠæ±ããµãŒããŒããéãããããµãŒããŒããããã·ã®èŠæ±ãåãä»ããŸããã
ãµãŒããŒãã¯ã©ã€ã¢ã³ãã®èŠæ±ã解æã§ããŸããã§ãããäžæ£ãªèŠæ±ãããèŠæ±ãç¯ã«æããããå¶éã«éåããèŠæ±ã§ãããã®ãšèŠãããŸãã
èŠæ±ãããè³æºãå©çšããã«ã¯ã¯ã©ã€ã¢ã³ã蚌ææžãå¿ èŠã§ããå¿ èŠãšãªãçç±ã®äŸãšããŠãã¢ã¯ã»ã¹å¶åŸ¡ãã¢ããªã±ãŒã·ã§ã³ã§ã®ãµãŒããŒåŽã®ç¶æ ã®ç¶æã«æŽ»çšããããšããããŸããèŠæ±ã蚌ææžãªãã«ãããå Žåããã®1床éãã«ãã¹ãã§ããèŠæ±ã蚌ææžä»ãã§ãããå ŽåããµãŒããŒã¯åãä»ããèŠæ±ã¯å¥ã®èšŒææžã§ç¹°ãè¿ãããã¹ãã§ããè¿œå æ å ±ã«ã¯èšŒææžãå¿ èŠãªçç±ãæ絶ããçç±ã«ã€ããŠã®è©³çŽ°ãå«ããããŸãããµãŒããŒã¯ããããæ å ±ãå«ããã¹ãã§ãããã¯ã©ã€ã¢ã³ãã¯å©çšè ã«è¡šç€ºãã¹ãã§ãããã®åé¡ã«ã¯3ã€ã®ç¶æ ã³ãŒããå®çŸ©ãããŠããŸãã
auth = "6" DIGIT [SP errormsg] CRLF errormsg = 1*(SP / VCHAR)
å 容ã¯ã¯ã©ã€ã¢ã³ã蚌ææžãèŠæ±ããŸããã¯ã©ã€ã¢ã³ãã¯å 容ãå©çšããããã«èšŒææžãæäŸããªããã°ãªããããã以äžèŠæ±ãç¹°ãè¿ãã¹ãã§ã¯ãããŸããããã®ç¶æ ã³ãŒãã«å¿çããäžã§çæããã蚌ææžã®ã¹ã³ãŒãã¯ããã®ç¶æ ã³ãŒããåãåããããã¹ããšããŒãçªå·ãšå ã®èŠæ±ã®URLã®ãã¹ã«ãã®äžã«ããå šãŠã®ãã¹ãå ãããã®ã«å¶éãããã¹ãã§ãããµãŒããŒã¯åããã¹ããšããŒãçªå·ã®ç°ãªããã¹ã§ç°ãªã蚌ææžãèŠæ±ããŠãæ§ããŸããããµãŒããŒã¯åã蚌ææžãéããã¹ã«ããä»»æã®å 容ã«äœ¿ããããã«ãã¹ãã§ãã以äžã«äŸã瀺ããŸãã
gemini://example.com/private/ -- 蚌ææžAãèŠæ± gemini://example.com/private/r1 -- 蚌ææžAãèŠæ± gemini://example.com/private/r2/r3 -- 蚌ææžAãèŠæ± gemini://example.com/other/ -- 蚌ææžBãèŠæ± gemini://example.com/other/r1 -- 蚌ææžBãèŠæ± gemini://example.com/other/r2/r3 -- 蚌ææžBãèŠæ± gemini://example.com/random -- 蚌ææžã¯äžèŠ
ã¯ã©ã€ã¢ã³ãã¯èªåã§ã¯ã©ã€ã¢ã³ã蚌ææžãçæããŠã¯ãªããããã®èšŒææžã䜿ã£ãŠå©çšè ã®äž»äœçãªé¢äžãªãèŠæ±ãç¹°ãè¿ããŠã¯ãªããŸãããã¯ã©ã€ã¢ã³ãã¯å©çšè ã«æ瀺ãããªãéããç°ãªããã¹ããç°ãªãããŒãçªå·ãå ã®èŠæ±ã®URLã®ãã¹ããäžã®åããã¹ããšããŒãçªå·ã®ãã¹ã«å¯ŸããèŠæ±ã§ããã®ç¶æ ã³ãŒããžã®å¿çã«çæãããã¯ã©ã€ã¢ã³ã蚌ææžã䜿ã£ãŠã¯ãªããŸããã
äžããããã¯ã©ã€ã¢ã³ã蚌ææžã¯ç¹å®ã®èŠæ±ãããè³æºã«ã¢ã¯ã»ã¹ããæš©éããããŸãããåé¡ã¯èšŒææžèªäœã«ã¯ç¡ããä»ã®è³æºã«ã€ããŠã¯æš©éãããå¯èœæ§ããããŸãã
äžããããã¯ã©ã€ã¢ã³ã蚌ææžãäžåœã§ããããåãä»ããããŸããã§ãããããã¯èšŒææžã®å 容ãããèªäœã«åé¡ãããããšã瀺ããŠãããç¹å®ã®èŠæ±ãããè³æºã«ã€ããŠã¯èæ ®ãããŸãããæããããããªåå ã¯ã蚌ææžã®åŠ¥åœæ§ã®éå§æ¥ãæªæ¥ã«ãªã£ãŠãããæéæ¥ãéããŠãããã§ããããã®ã³ãŒãã¯äžåœãªæžåãX509æšæºèŠä»¶ã®éåã瀺ããŠããå¯èœæ§ããããŸãã
å·çæç¹ (2021) ã§ãå šãŠã®æ¢åã®TLSã©ã€ãã©ãªãTLS 1.3ã«å¯Ÿå¿ããŠããããã§ã¯ãããŸããããå€æ°ïŒå šãŠïŒïŒãTLS 1.2ã«å¯Ÿå¿ããŠããããã®ããTLS 1.2ãæå°ããŒãžã§ã³èŠä»¶ãšãªããŸããå®è£ è ã¯TLS 1.2ããããã³ã«ã®æå·åã®äº€æžæ®µéã®äžéšãšããŠãµãŒããŒåãšïŒãã䜿ãããå Žåã¯ïŒã¯ã©ã€ã¢ã³ã蚌ææžãå¹³ã§éãããšã«ãçæãã ãããã¯ã©ã€ã¢ã³ãã¯TLS 1.2æ¥ç¶ã確ç«ããããšãã«èŠåããŠãæ§ããŸããããŸãã¯ã©ã€ã¢ã³ã蚌ææžãTLS 1.2ãä»ããŠè»¢éããããšãã«å©çšè ã«èŠåãã¹ãã§ãã
GeminiãµãŒããŒã¯æ¥ç¶ãéããããã«TLSã®close_notifyã®å®è£ ã䜿ããªããã°ãªããŸãããã¯ã©ã€ã¢ã³ãã¯æ¢å®ã§æ¥ç¶ãéããã¹ãã§ã¯ãããŸããããå©çšè ã«ããèšå®ãããå¶éãè¶ ããå 容ã®å Žåã¯æ§ããŸãããã¯ã©ã€ã¢ã³ããšãµãŒããŒã®äž¡æ¹ãšãTLSã®close_notifyã®ä»çµã¿ã䜿ãããªãã£ããšãïŒäŸãã°é©åã«TLSæ¥ç¶ãçµäºãããããšãªããœã±ãããéããäœå±€ã®ãœã±ãããšã©ãŒïŒãæ±ãã¹ãã§ããã¯ã©ã€ã¢ã³ãã¯ããããå Žåã«å©çšè ã«éç¥ãã¹ãã§ãããµãŒããŒã¯ããããå Žåããã°ã«åºããŠãæ§ããŸããã
ã¯ã©ã€ã¢ã³ããšãµãŒããŒã®å®è£ ã¯TLSãµãŒããŒå衚瀺 (Server Name Indication; SNI) ã«å¯Ÿå¿ããªããã°ãªããŸãããã¯ã©ã€ã¢ã³ãã¯æš©åšç¯ããã¹ãåã§ããURLãžã®èŠæ±æã«ãã¹ãåã®æ å ±ãå«ããªããã°ãªããŸããã
Geminiãããã³ã«ä»æ§ã¯ãã¯ã©ã€ã¢ã³ããåãåã£ããµãŒããŒèšŒææžãæ€èšŒããããã«äœ¿ããªããã°ãããªãç¹å®ã®ã¡ãœãããèŠå®ããŸãããGeminiã®å®è£ ã¯ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ããŠã§ããã©ãŠã¶ã§æäŸããããäºãä¿¡é ŒãããèªèšŒå±ã®äžèŠ§ã«äŸåããåºã䜿ãããææ³ä»¥å€ã®ã代æ¿ãæ€èšŒã¹ããŒã ã«ã€ããŠããããã³ã«ã®èµ·æºä»¥æ¥ãéå ¬åŒã«è©Šã¿ãŠããŸãããããããææ³ã®æ£åŒãªä»æ§ã¯å®è·µãç©ã¿éããŠããäžã§é²å±ããŠãããããããŸããã
ã¯ã©ã€ã¢ã³ãã¯Trust On First Useã䜿ãããšã匷ãæšå¥šãããŸãããTOFUããšãåŒã°ãã蚌ææžããã³çãããä»çµã¿ã§ãããæ€èšŒã®ä»çµã¿ã®ååãšããŠãèªå·±æžå蚌ææžãäžåœãšããŠæ絶ããŸããããã®ãããªä»çµã¿ã«ãããŠã¯ããŸãGeminiã¯ã©ã€ã¢ã³ãããµãŒããŒã«æ¥ç¶ãããšããäœã§ããæ瀺ããã蚌ææžãåãä»ããŸãããã®èšŒææžã®æçŽãšæéæ¥ã¯æ°žç¶çãªããŒã¿ããŒã¹ã«ä¿åããããµãŒããŒã®ãã¹ãåãšããŒãçªå·ã«çŽä»ããŸãã以éã®ãã®ãã¹ãåãšããŒãçªå·ãžã®æ¥ç¶ã§ã¯æ¯åãåãåã£ã蚌ææžã®æçŽãèšç®ããããŒã¿ããŒã¹ã«ä¿ç®¡ãããŠãããã®ãšæ¯èŒãããŸããæçŽãåèŽããªãã以åã®èšŒææžã®æéæ¥ãéããŠããªããã°ãããã¯äžéè æ»æã®èšŒæ ã®å¯èœæ§ããããšèããããŸããã¯ã©ã€ã¢ã³ãã¯ãã®åºæ¬çãªä»çµã¿ãè¿œå ã®ã»ãã¥ãªãã£å¯Ÿçã§æ¡åŒµããŠãæ§ããŸãããäŸãã°è€æ°ã®ãããã¯ãŒã¯ã®èŠç¹ã§åãåã£ã蚌ææžãæ¯èŒãããDNS Based Authentication of Named Entities (DANE) [RFC6698] ã䜿ã£ãããããªã©ã§ãã
è³æºãèŠæ±ãããGeminiã¯ã©ã€ã¢ã³ãã¯éåžžãè³æºã®gemini://ã®URLã®æš©åšéšåã§ç€ºããããµãŒããŒã«é©åãªèŠæ±ãéãããšãæåŸ ãããŸãããããã¯ã©ã€ã¢ã³ãã¯ä»£ããŠå ãããŠå ã®ãµãŒããŒã«æ¥ç¶ãå¿çãäžç¶ããäžç¶ãµãŒããŒã«éãããæ§æããŠãæ§ããŸãããããããäžç¶åšïŒä»¥éããããã·ãïŒèªäœãä»ã®ãããã·ã䜿ã£ãŠãæ§ããŸãããããããŠãŠãŒã¶ãŒãšãŒãžã§ã³ããšå ã®ãµãŒããŒã®éã«ãããã·ã®é£éã圢æãããŸãã
Geminiãããã·ãæäŸããè£å©ãµãŒãã¹ã«ã¯ä»¥äžãå«ãŸããŸããããã®éãã§ã¯ãããŸããã
Geminiãããã·ã«ã€ããŠãããã³ã«æ°Žæºã«ç¹å¥ãªããšã¯ãããŸãããã¯ã©ã€ã¢ã³ãããããã«æ¥ç¶ãèŠæ±ãéããšãäžã§è©³è¿°ããéããæ®éã®ãGeminiãµãŒããŒã«æ¥ç¶ããã®ãšå šãåãæ¹æ³ã§å¿çã解éããŸãããã¡ããGeminiãããã·ããŸãGeminiãµãŒããŒã§ãïŒãã ãå šãŠã®ãµãŒããŒããããã·ãšã¯éããŸããïŒãGeminiãããã·ã®ä»ãšã¯éãç¹åŸŽã¯ããææããŠããªããè³æºãžã®èŠæ±ãæ±ããããšã§ãããããã·ã¯ããããèŠæ±ã ããæ±ãå¿ èŠã¯ãããŸãããåããã·ã³ã§èµ°ãåãããã°ã©ã ã¯ãèŠæ±ã«ãããã·ãšããŠå¿çãããããªãã£ããããŠæ§ããŸããã
Geminiãããã·ãå ã®ãµãŒããŒã«æ¥ç¶ããŠæšæºçãªGeminiã®èŠæ±ãšå¿çã®ããåããå®äºãããšãããã€å ã®ãµãŒããŒããåãåã£ãå¿çã®ç¶æ ã³ãŒãããšã©ãŒã³ãŒãã§ãããšãïŒã€ãŸã1æ¡ç®ã4ã5ïŒããããã·ã¯åãå¿çãããããŠãŒã¶ãŒãšãŒãžã§ã³ãã«éãã¹ãã§ãã
ç¶æ ã³ãŒã43ããããã·ãšã©ãŒãã¯Geminiãããã·ãé éãã¹ããšã®ããåããæ£åžžã«å®äºã§ããªãã£ãå Žåã§äœ¿ãããšãç®çãšããŠããŸããããã§ã®ãæ£åžžã«ãã®æå³ã¯å¿çã³ãŒã20ãæåããåãåãããšã§ã¯ãããŸããããããã·ãç¶æ ã³ãŒã43ã®å¿çãè¿ãã¹ãç¶æ³ã«ã¯ä»¥äžããããŸããããã®éãã§ã¯ãããŸããã
ãããã·ã¯å ã®ãµãŒããŒãšã®Geminiãã©ã³ã¶ã¯ã·ã§ã³ãå®äºããŠã¯ã©ã€ã¢ã³ã蚌ææžã®èŠæ±ãåãåã£ãåŸã«ããããã·ããããŸã§ã«é¢ä¿ããè³æºã«äœ¿ãããã®ã¯ã©ã€ã¢ã³ã蚌ææžãšçŽä»ãç§æéµã§æ§æãããŠããªããã°ãç¶æ ã³ãŒã43ã䜿ã£ãŠãæ§ããŸããããŠãŒã¶ãŒãšãŒãžã§ã³ããããããçæããŠå ã®ãµãŒããŒã«æ¥ç¶ããäžã§åå©çšããããã«ãããã·ã«æž¡ãçŽæçãã€ã€ã³ãã³ããªæ¹æ³ã¯ãããŸããã
Geminiãããã·ã¯ãŠãŒã¶ãŒãšãŒãžã§ã³ããšå ã®ãµãŒããŒã®éã®ãäžéè ãã§ãããããã©ã€ãã·ãŒãšã»ãã¥ãªãã£ã«åœ±é¿ããŸããGeminiãããã·ã¯ãŠãŒã¶ãŒãšãŒãžã§ã³ããšå ã®ãµãŒããŒã®éã®ãšã³ãããŒãšã³ãã®TLSæå·ãæ©èœããŠããŸããïŒãããçç±ã§ãããã·ãšåŒã°ããã³ãã«ãšã¯åŒã°ããŸããïŒãGeminiãããã·ã«ã¯å¿çãšèŠæ±ã®äž¡æ¹ã奜ãã«å€æŽãããæ°žä¹ ã«ãã°ã«æ§ãããããèœåããããŸãã
ãããã£ãŠGeminiãããã·ã¯ä¿¡é Œãããéå£ã念é ã«çœ®ããŠããŸããæåŸ ãããŠããããããçšéã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ããšåããã·ã³ã§ããŒã«ã«ã§èµ°ã£ãŠããããåãããŒã«ã«ãããã¯ãŒã¯ã«ããåãå©çšè ã«ããéçšãããŠããéããã·ã³ã§èµ°ã£ãŠãããããã·ã§ãããµãŒãããŒãã£ã«ããéçšãããŠããé éGeminiãããã·ã䜿ãããšã¯ãã®ãµãŒãããŒãã£ãžã®é«åºŠãªä¿¡é ŒãèŠããŸããå©çšè ãšé éãããã·ã®éçšè ã®äž¡æ¹ãTLS蚌ææžã®æçŽã泚ææ·±ã確èªããã°é«åºŠãªå éšã®ä¿¡é Œã®ããå°ããªã³ãã¥ããã£å ã§ãããã·ã®å ±æã掻çšã§ããŸãã
äžã®èæ ®äºé ãå¹³æã«èšããšä»¥äžãšãªããŸãã
以äžã®äŸã¯ãµãŒããŒãšã¯ã©ã€ã¢ã³ã2ã€ã®éå£ããããŸããããããã®åäœã¯è§æ¬åŒ§ã[]ãã§å²ãŸããŠãããæåã³ãŒã13ãš10ã瀺ããCRLFãã®ãããªå¹Ÿã€ãã®çµç«¯èšå·ãšå ±ã«ããã¹ãè¡šèšã¯åŒçšç¬Šã§å²ãŸããŸãïŒãã ãåŒçšç¬Šã¯å ¥åã«å«ãŸããŸããïŒããmimeçš®å¥ã㯠[RFC2045] ã«ããMIMEçš®å¥ãè¡šããå 容âŠâŠãã¯èŠæ±ãããå 容ã®æå³ã§ãã
以äžã®äŸã§ã¯ããµãŒããŒãå©çšè ã®å ¥åãèŠæ±ããã¯ã©ã€ã¢ã³ããåéããå©çšè ã®å ¥å蟌ã¿ã§èŠæ±ãåæåºããŠããŸãã
Client: æ¥ç¶ãéã Client: "gemini://example.net/search" CRLF Server: "10 æ€çŽ¢ããèšèãå ¥åããŠãã ãã" CRLF Server: æ¥ç¶ãéãã Client: å©çšè ã«ããã³ãããåºãŠå ¥åãåŸãããŸã Client: æ¥ç¶ãéã Client: "gemini://example.net/search?gemini%20search%20engines" CRLF Server: "20 " mimeçš®å¥ CRLF å 容âŠâŠ Server: æ¥ç¶ãéãã
ã¯ã©ã€ã¢ã³ããå 容ãèŠæ±ããŸãããã®äŸã§ã¯ç»åãã¡ã€ã«ã§ãã
Client: æ¥ç¶ãéã Client: "gemini://example.net/image.jpg" CRLF Server: "20 image/jpeg" CRLF <binary data of JPEG image> Server: æ¥ç¶ãéãã
ãã®äŸã§ã¯ãµãŒããŒãè³æºã®æ°ããå Žæãžã¯ã©ã€ã¢ã³ãããªãã€ã¬ã¯ãããŠããŸãã
Client: æ¥ç¶ãéã Client: "gemini://example.net/current" CRLF Server: "30 /new" CRLF Server: æ¥ç¶ãéãã Client: æ¥ç¶ãéã Client: "gemini://example.net/new" CRLF Server: "20 " mimeçš®å¥ CRLF å 容âŠâŠ Server: æ¥ç¶ãéãã
以äžã¯ãµãŒããŒãã¯ã©ã€ã¢ã³ã蚌ææžãèŠæ±ããã¯ã©ã€ã¢ã³ããç¶ãèŠæ±ã§èšŒææžãæäŸããŠããŸãã
Client: æ¥ç¶ãéããã¯ã©ã€ã¢ã³ã蚌ᅵᅵæžã¯éãããŠããªã Client: "gemini://example.net/protected/" CRLF Server: "60 ãã®è³æºã«ã¢ã¯ã»ã¹ããã«ã¯èšŒææžãå¿ èŠã§ã" CRLF Server: æ¥ç¶ãéãã Client: ã¢ããªã±ãŒã·ã§ã³ã蚌ææžãåŸãããã«äœããã®åäœããã Client: æ¥ç¶ãéããã¯ã©ã€ã¢ã³ãã¯èšŒææžãéã Client: "gemini://example.net/protected/" CRLF Server: "20 " mimeçš®å¥ CRLF å 容âŠâŠ Server: æ¥ç¶ãéãã
ãã®äŸã§ã¯ã¯ã©ã€ã¢ã³ã蚌ææžãšå©çšè ã®å ¥åãæããŠå©çšè æ¯ã®ãµãŒããŒåŽã®ç¶æ ãç¶æããŠ2ã€ã®æ°åãå ç®ããæå°ã®äŸãäžããŠããŸãã
Client: æ¥ç¶ãéããã¯ã©ã€ã¢ã³ã蚌ææžã¯éãããŠããªã Client: "gemini://example.net/application/" CRLF Server: "60 ãµãŒããŒåŽç¶æ ãä¿ã€ããã«èšŒææžãå¿ èŠã§ã" CRLF Server: æ¥ç¶ãéãã Client: ã¢ããªã±ãŒã·ã§ã³ã蚌ææžãåŸãããã«äœããã®åäœããã Client: æ¥ç¶ãéããã¯ã©ã€ã¢ã³ã蚌ææžãéããã Client: "gemini://example.net/application/" CRLF Server: "10 0ãš9000ã®éã®æ°å€ãå ¥ããŠãã ãã" CRLF Server: æ¥ç¶ãéãã Client: å©çšè ã«ããã³ãããåºããå ¥åãåŸã Client: æ¥ç¶ãéããã¯ã©ã€ã¢ã³ã蚌ææžãéããã Client: "gemini://example.net/application/?42" CRLF Server: ã¯ã©ã€ã¢ã³ã蚌ææžãèªèãã蚌ææžã«çŽä»ãã¡ã¢ãªãªãããã£ã¹ã¯ã«å€ã42ããä¿ç®¡ãã Server: "10 0ãš9000ã®éã®å¥ã®æ°å€ãå ¥ããŠãã ãã" CRLF Server: æ¥ç¶ãéãã Client: å©çšè ã®ããã³ãããåºããå ¥åãåŸã Client: æ¥ç¶ãéããã¯ã©ã€ã¢ã³ã蚌ææžãéããã Client: "gemini://example.net/application/?1923" CRLF Server: ã¯ã©ã€ã¢ã³ã蚌ææžãèªèããä¿ç®¡ãããå€ã42ããåãåºããåãåã£ãå€ã1923ãã«å ãã Server: "20 text/plain" CRLF "42足ã1923ã¯1965ã§ãããããããã" Server: æ¥ç¶ãéãã
ãã®äŸã§ã¯ãµãŒããŒã¯ãšã©ãŒã説æããè¿œå ããã¹ãä»ãã§äžæçãªå€±æãéããŸãã
Client: æ¥ç¶ãéã Client: "gemini://example.net/data" CRLF Server: "41 çŸåšã¯ä¿å®äœæ¥äž" CRLF Server: æ¥ç¶ãéãã
æåŸã®äŸã¯ããã以äžã®èª¬æã®ãªãæ°žç¶çãªå€±æã®ãã®ã§ãã
Client: æ¥ç¶ãéã Client: "gemini://example.net/data" CRLF Server: "50" CRLF Server: æ¥ç¶ãéãã