ðŸ Archived View for geminiprotocol.net ⺠docs ⺠ja ⺠protocol-specification.gmi captured on 2024-08-24 at 23:46:08. Gemini links have been rewritten to link to archived content
â¬ ïž Previous 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ã®ä»æ§ã¯å¥éå®ããããŸãã
ãã®åé¡ã«å®çŸ©ãããç¶æ ã¯20ã ãã§ãã
success = "2" DIGIT SP mimetype CRLF body mimetype = type "/" subtype *(";" parameter) body = *OCTET
ãµãŒããŒã§ã¯èŠæ±ãæ£åžžã«è§£æããŠç解ãããäžããããMIMEçš®å¥ã®å 容ãéãå±ããŸãã
ãµãŒããŒããã¯ã©ã€ã¢ã³ãã«ãå 容ã®ããæ°ããå ŽæãéããŸããè¿œå æ å ±ã¯çµ¶å¯ŸãŸãã¯çžå¯Ÿã®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ã¯ã©ã€ã¢ã³ãã¯éåžžãè³æºã®ããURL gemini://ã®ãæš©åšéšåã§ç€ºããããµãŒããŒã«ãé©åãªèŠæ±ãéãããšãæåŸ ãããŸãããããã¯ã©ã€ã¢ã³ãã§ã¯ããŸãäžç¶ãµãŒããŒã«éãããæ§æããŠãæ§ããŸããããããŠãã®ãµãŒããŒããå ã éãããšã«ãªã£ãŠãããµãŒããŒã«æ¥ç¶ããå¿çãäžç¶ããã®ã§ããããããäžç¶åšïŒä»¥äžããããã·ãïŒããŸããä»ã®ãããã·ã䜿ã£ãŠãæ§ããŸãããããããŠããŠãŒã¶ãŒãšãŒãžã§ã³ããšå ã®ãµãŒããŒã®éã«ããããã·ã®é£éã圢æãããŸãã
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: æ¥ç¶ãéãã