From 984fdb2b58bff0eeb4b4a4abe78b39ae3fd77861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 14 Apr 2024 19:00:05 +0200 Subject: [PATCH] relay: add TLS connection to remote, add remote option "tls_verify" --- po/cs.po | 62 +++- po/de.po | 66 ++++- po/es.po | 64 ++++- po/fr.po | 57 +++- po/hu.po | 53 +++- po/it.po | 64 ++++- po/ja.po | 65 ++++- po/pl.po | 67 ++++- po/pt.po | 66 ++++- po/pt_BR.po | 60 +++- po/ru.po | 54 +++- po/sr.po | 67 ++++- po/tr.po | 66 ++++- po/weechat.pot | 53 +++- .../relay/api/remote/relay-remote-network.c | 270 ++++++++++++++++-- src/plugins/relay/relay-command.c | 23 +- src/plugins/relay/relay-config.c | 8 + src/plugins/relay/relay-remote.c | 34 ++- src/plugins/relay/relay-remote.h | 10 +- .../api/remote/test-relay-remote-network.cpp | 4 +- 20 files changed, 1161 insertions(+), 52 deletions(-) diff --git a/po/cs.po b/po/cs.po index 7e20e8e2a..7f6bc55e0 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -13703,6 +13703,66 @@ msgstr "%s%s: časový limit" msgid "%sremote[%s]: unable to create socket" msgstr "%s%s: nemohu vytvořit soket" +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "gnutls: certifikát protějška je důvěryhodný" + +#, fuzzy, c-format +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "gnutls: přijímám %d certifikát" +msgstr[1] "gnutls: přijímám %d certifikáty" +msgstr[2] "gnutls: přijímám %d certifikátů" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: nemůžu číst certifikát \"%s\"" + +#, fuzzy, c-format +#| msgid "%s - certificate[%d] info:" +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - informace o certifikátu[%d] :" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: certifikát vypršel" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: certifikát ještě nebyl aktivován" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sguntls: jméno hosta v certifikátu NODPOVÍDÁ \"%s\"" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: chyba při kontrole certifikátu protěška" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: certifikát protějška NENÍ důvěryhodný" + +#, fuzzy, c-format +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "%sgnutls: certifikát protějška NENÍ důvěryhodný" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnutls: vydavatel certifikátu protějška je neznámý" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: certifikát byl zrušen" + #, fuzzy, c-format msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" msgstr "%s%s: čtu data ze soketu: chyba %d %s" diff --git a/po/de.po b/po/de.po index 7c667507d..e8d913c01 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-12 16:40+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -15135,6 +15135,70 @@ msgstr "%sremote[%s]: Zeitüberschreitung" msgid "%sremote[%s]: unable to create socket" msgstr "%sremote[%s]: Socket kann nicht erstellt werden" +#, fuzzy, c-format +#| msgid "%sgnutls: failed to initialize certificate structure" +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sgnutls: Zertifikatsstruktur konnte nicht initialisiert werden" + +#, fuzzy, c-format +#| msgid "%sgnutls: receiving %d certificate" +#| msgid_plural "%sgnutls: receiving %d certificates" +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "%sgnutls: empfange %d Zertifikat" +msgstr[1] "%sgnutls: empfange %d Zertifikate" + +#, fuzzy, c-format +#| msgid "%sgnutls: failed to import certificate[%d]" +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: Zertifikat[%d] konnte nicht importiert werden" + +#, fuzzy, c-format +#| msgid "%s - certificate[%d] info:" +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - Zertifikat[%d]-Information:" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: die Gültigkeitsdauer des Zertifikates ist abgelaufen" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: Zertifikat ist noch nicht freigeschaltet" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sgnutls: der Hostname im Zertifikat \"%s\" stimmt NICHT überein" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: Fehler bei der Überprüfung des Peer-Zertifikates" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: Peer-Zertifikat ist NICHT vertrauenswürdig" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is trusted" +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "%sgnutls: Peer-Zertifikat ist vertrauenswürdig" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnutls: Der Aussteller für das Peer-Zertifikat ist unbekannt" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: Das Zertifikat wurde widerrufen" + #, c-format msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" msgstr "%sremote[%s]: Handshake mit URL %s fehlgeschlagen, Rückgabewert: %s" diff --git a/po/es.po b/po/es.po index f6c1bfb25..79e3e42b9 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -14026,6 +14026,68 @@ msgstr "%s%s: agotado tiempo de espera" msgid "%sremote[%s]: unable to create socket" msgstr "%s%s: no es posible crear el socket" +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sgnutls: el certificado del par es confiable" + +#, fuzzy, c-format +#| msgid "%sgnutls: receiving %d certificate" +#| msgid_plural "%sgnutls: receiving %d certificates" +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "%sgnutls: recibiendo %d certificado" +msgstr[1] "%sgnutls: recibiendo %d certificados" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: no es posible leer el certificado \"%s\"" + +#, fuzzy, c-format +#| msgid "%s - certificate[%d] info:" +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - información del certificado[%d]:" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: el certificado ha expirado" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: el certificado es ha sido activado aún" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sgnutls: el hostname en el certificado NO concuerda con \"%s\"" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: error mientras se verificaba el certificado del par" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: el certificado del par NO es confiable" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is trusted" +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "%sgnutls: el certificado del par es confiable" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnutls: el emisor del certificado del par es desconocido" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: el certificado ha sido revocado" + #, fuzzy, c-format #| msgid "%s%s: TLS handshake failed for client %s%s%s: error %d %s" msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" diff --git a/po/fr.po b/po/fr.po index 11ec418aa..fc1f83054 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" -"PO-Revision-Date: 2024-04-12 22:56+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" +"PO-Revision-Date: 2024-04-14 18:58+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -14790,6 +14790,59 @@ msgstr "%sremote[%s] : délai d'attente dépassé" msgid "%sremote[%s]: unable to create socket" msgstr "%sremote[%s] : impossible de créer le socket" +#, c-format +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sremote[%s] : échec d'initialisation de la structure du certificat" + +#, c-format +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "remote[%s] : gnutls : réception de %d certificat" +msgstr[1] "remote[%s] : gnutls : réception de %d certificats" + +#, c-format +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sremote[%s] : gnutls : impossible d'importer le certificat[%d]" + +#, c-format +msgid "remote[%s] - certificate[%d] info:" +msgstr "remote[%s] - info certificat[%d] :" + +#, c-format +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sremote[%s] : gnutls : le certificat a expiré" + +#, c-format +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sremote[%s] : gnutls : le certificat n'a pas encore été activé" + +#, c-format +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "" +"%sremote[%s] : gnutls : le nom d'hôte du certificat ne correspond PAS à " +"\"%s\"" + +#, c-format +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sremote[%s] : gnutls : erreur de vérification du certificat de l'hôte" + +#, c-format +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sremote[%s] : gnutls : le certificat de l'hôte n'est PAS de confiance" + +#, c-format +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "remote[%s] : gnutls : le certificat de l'hôte est de confiance" + +#, c-format +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sremote[%s] : gnutls : l'émetteur du certificat de l'hôte est inconnu" + +#, c-format +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sremote[%s] : gnutls : le certificat a été révoqué" + #, c-format msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" msgstr "" diff --git a/po/hu.po b/po/hu.po index 62a4c8e84..059bd7aaf 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -13146,6 +13146,57 @@ msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n" msgid "%sremote[%s]: unable to create socket" msgstr "%s nem sikerült a szervert létrehozni\n" +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, fuzzy, c-format +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "Nem sikerült a(z) \"%s\" naplófájlt írni\n" +msgstr[1] "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, c-format +msgid "remote[%s] - certificate[%d] info:" +msgstr "" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, fuzzy, c-format +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%s adatküldési hiba az IRC szerveren\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, fuzzy, c-format +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + #, fuzzy, c-format msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" msgstr "%s adatküldési hiba az IRC szerveren\n" diff --git a/po/it.po b/po/it.po index 081a13bcc..4a6f3b48f 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -14040,6 +14040,68 @@ msgstr "%s%s: timeout" msgid "%sremote[%s]: unable to create socket" msgstr "%s%s: impossibile creare il socket" +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sgnutls: il certificato del peer è fidato" + +#, fuzzy, c-format +#| msgid "%sgnutls: receiving %d certificate" +#| msgid_plural "%sgnutls: receiving %d certificates" +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "%sgnutls: ricezione di %d certificato" +msgstr[1] "%sgnutls: ricezione di %d certificati" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: impossibile leggere il certificato \"%s\"" + +#, fuzzy, c-format +#| msgid "%s - certificate[%d] info:" +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - info certificato[%d]:" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: il certificato è scaduto" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: il certificato non è ancora attivo" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sgnutls: il nome host nel certificato NON coincide \"%s\"" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: errpre nella verifica del certificato del peer" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: il certificato del peer NON è fidato" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is trusted" +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "%sgnutls: il certificato del peer è fidato" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnults: il fornitore del certificato del peer è sconosciuto" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: il certificato è stato revocato" + #, fuzzy, c-format #| msgid "%s%s: TLS handshake failed for client %s%s%s: error %d %s" msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" diff --git a/po/ja.po b/po/ja.po index ce576f4d9..ed09ea1d0 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: weechat-dev \n" @@ -14476,6 +14476,71 @@ msgstr "%s%s: timeout" msgid "%sremote[%s]: unable to create socket" msgstr "%s%s: nie można utworzyć gniazda" +#, fuzzy, c-format +#| msgid "%sgnutls: failed to initialize certificate structure" +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sgnutls: nie udało się zainicjować struktury certyfikatu" + +#, fuzzy, c-format +#| msgid "%sgnutls: receiving %d certificate" +#| msgid_plural "%sgnutls: receiving %d certificates" +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "%sgnutls: odbieram %d certyfikat" +msgstr[1] "%sgnutls: odbieram %d certyfikaty" +msgstr[2] "%sgnutls: odbieram %d certyfikatów" + +#, fuzzy, c-format +#| msgid "%sgnutls: failed to import certificate[%d]" +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: nie udało się zaimportować certyfikatu[%d]" + +#, fuzzy, c-format +#| msgid "%s - certificate[%d] info:" +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - certyfikat[%d] - informacje:" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: certyfikat wygasł" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: certyfikat nie jest jeszcze aktywny" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sgnutls: nazwa hosta w certyfikacie NIE pasuje do \"%s\"" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: błąd podczas sprawdzania certyfikatu partnera" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: certyfikat partnera NIE jest zaufany" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is trusted" +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "%sgnutls: certyfikat partnera jest zaufany" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnutls: nieznany wystawca certyfikatu partnera" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: certyfikat został unieważniony" + #, fuzzy, c-format #| msgid "%s%s: TLS handshake failed for client %s%s%s: error %d %s" msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" diff --git a/po/pt.po b/po/pt.po index 79f063d54..fc88254cf 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -14377,6 +14377,70 @@ msgstr "%s%s: tempo limite" msgid "%sremote[%s]: unable to create socket" msgstr "%s%s: não foi possível criar socket" +#, fuzzy, c-format +#| msgid "%sgnutls: failed to initialize certificate structure" +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sgnutls: falha ao inicializar estrutura do certificado" + +#, fuzzy, c-format +#| msgid "%sgnutls: receiving %d certificate" +#| msgid_plural "%sgnutls: receiving %d certificates" +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "%sgnutls: a receber %d certificado" +msgstr[1] "%sgnutls: a receber %d certificados" + +#, fuzzy, c-format +#| msgid "%sgnutls: failed to import certificate[%d]" +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: falha ao importar certificado[%d]" + +#, fuzzy, c-format +#| msgid "%s - certificate[%d] info:" +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - info certificado[%d]:" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: o certificado expirou" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: o certificado ainda não foi ativado" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sgnutls: o hostname no certificado NÃO corresponde a \"%s\"" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: erro ao verificar certificado do par" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: o certificado do par NÃO é fidedigno" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is trusted" +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "%sgnutls: o certificado do par é fidedigno" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnutls: o emissor do certificado do par é desconhecido" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: o certificado foi revogado" + #, fuzzy, c-format #| msgid "%s%s: TLS handshake failed for client %s%s%s: error %d %s" msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" diff --git a/po/pt_BR.po b/po/pt_BR.po index 5cb0aa5e4..4784558cb 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -13560,6 +13560,64 @@ msgstr "%s%s: tempo esgotado" msgid "%sremote[%s]: unable to create socket" msgstr "%s%s: não foi possível criar pipe" +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sgnutls: certificado do parceiro é confiável" + +#, fuzzy, c-format +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "gnutls: recebendo %d certificado" +msgstr[1] "gnutls: recebendo %d certificados" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: não foi possível ler certificado[%d]" + +#, fuzzy, c-format +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - informações do certificado[%d]:" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: certificado foi expirado" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: certificado ainda não é ativo" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sgnutls: o hostname no certificado NÃO É semelhante a \"%s\"" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: erro ao verificar certificado do parceiro" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: certificado do parceiro NÃO É confiável" + +#, fuzzy, c-format +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "gnutls: certificado do parceiro é confiável" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnutls: gerador do certificado do parceiro é desconhecido" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: o certificado foi revogado" + #, fuzzy, c-format msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" msgstr "%s%s: lendo dados no socket: erro %d %s" diff --git a/po/ru.po b/po/ru.po index d27c93cec..eb5e0b546 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -13198,6 +13198,58 @@ msgstr "%s нет аргумента для параметра \"%s\"\n" msgid "%sremote[%s]: unable to create socket" msgstr "%s не могу создать сервер\n" +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "Не могу записать лог-файл \"%s\"\n" + +#, fuzzy, c-format +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "Не могу записать лог-файл \"%s\"\n" +msgstr[1] "Не могу записать лог-файл \"%s\"\n" +msgstr[2] "Не могу записать лог-файл \"%s\"\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "Не могу записать лог-файл \"%s\"\n" + +#, c-format +msgid "remote[%s] - certificate[%d] info:" +msgstr "" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "Не могу записать лог-файл \"%s\"\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "Не могу записать лог-файл \"%s\"\n" + +#, fuzzy, c-format +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "Не могу записать лог-файл \"%s\"\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%s ошибка при отправке данных IRC серверу\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "Не могу записать лог-файл \"%s\"\n" + +#, fuzzy, c-format +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "Не могу записать лог-файл \"%s\"\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "Не могу записать лог-файл \"%s\"\n" + +#, fuzzy, c-format +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "Не могу записать лог-файл \"%s\"\n" + #, fuzzy, c-format msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" msgstr "%s ошибка при отправке данных IRC серверу\n" diff --git a/po/sr.po b/po/sr.po index eadf8e0cb..316264fa0 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -14464,6 +14464,71 @@ msgstr "%s%s: тајмаут" msgid "%sremote[%s]: unable to create socket" msgstr "%s%s: није могао да се креира сокет" +#, fuzzy, c-format +#| msgid "%sgnutls: failed to initialize certificate structure" +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sgnutls: није успела иницијализација структуре сертификата" + +#, fuzzy, c-format +#| msgid "%sgnutls: receiving %d certificate" +#| msgid_plural "%sgnutls: receiving %d certificates" +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "%sgnutls: прима се %d сертификат" +msgstr[1] "%sgnutls: прима се %d сертификата" +msgstr[2] "%sgnutls: прима се %d сертификата" + +#, fuzzy, c-format +#| msgid "%sgnutls: failed to import certificate[%d]" +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: није успео увоз сертификата[%d]" + +#, fuzzy, c-format +#| msgid "%s - certificate[%d] info:" +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - сертификат[%d] инфо:" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: истекла је важност сертификата" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: сертификат још увек није активиран" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sgnutls: име хоста у сертификату се НЕ подудара са „%s”" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: грешка приликом провере сертификата друге стране" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: сертификату друге стране се НЕ верује" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is trusted" +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "%sgnutls: сертификату друге стране се верује" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnutls: издавач сертификата друге стране није познат" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: сертификат је повучен" + #, fuzzy, c-format #| msgid "%s%s: TLS handshake failed for client %s%s%s: error %d %s" msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" diff --git a/po/tr.po b/po/tr.po index d5ccab4db..3483ebd81 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -14623,6 +14623,70 @@ msgstr "%s%s: Zaman aşımı" msgid "%sremote[%s]: unable to create socket" msgstr "%s%s: Soket oluşturulamıyor" +#, fuzzy, c-format +#| msgid "%sgnutls: failed to initialize certificate structure" +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "%sgnutls: Sertifika yapısı başlatılamadı" + +#, fuzzy, c-format +#| msgid "%sgnutls: receiving %d certificate" +#| msgid_plural "%sgnutls: receiving %d certificates" +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "%sgnutls: %d sertifika alınıyor" +msgstr[1] "%sgnutls: %d sertifika alınıyor" + +#, fuzzy, c-format +#| msgid "%sgnutls: failed to import certificate[%d]" +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "%sgnutls: Sertifika[%d] içe aktarılamadı" + +#, fuzzy, c-format +#| msgid "%s - certificate[%d] info:" +msgid "remote[%s] - certificate[%d] info:" +msgstr "%s - sertifika[%d] bilgisi:" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate has expired" +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "%sgnutls: Sertifika süresi dolmuş" + +#, fuzzy, c-format +#| msgid "%sgnutls: certificate is not yet activated" +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "%sgnutls: Sertifika henüz etkinleştirilmemiş" + +#, fuzzy, c-format +#| msgid "%sgnutls: the hostname in the certificate does NOT match \"%s\"" +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "%sgnutls: Sertifikadaki kullanıcı adı \"%s\" ile eşleşmiyor" + +#, fuzzy, c-format +#| msgid "%sgnutls: error while checking peer's certificate" +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "%sgnutls: Kullanıcının sertifikaları denetlenirken hata" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is NOT trusted" +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "%sgnutls: Kullanıcının sertifikasına güvenilmiyor" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate is trusted" +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "%sgnutls: Kullanıcının sertifikasına güveniliyor" + +#, fuzzy, c-format +#| msgid "%sgnutls: peer's certificate issuer is unknown" +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "%sgnutls: Kullanıcının sertifika vericisi bilinmiyor" + +#, fuzzy, c-format +#| msgid "%sgnutls: the certificate has been revoked" +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "%sgnutls: Sertifika geri alınmış" + #, fuzzy, c-format #| msgid "%s%s: TLS handshake failed for client %s%s%s: error %d %s" msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" diff --git a/po/weechat.pot b/po/weechat.pot index 88be6b215..46ecad635 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-04-12 22:18+0200\n" +"POT-Creation-Date: 2024-04-14 18:54+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -12017,6 +12017,57 @@ msgstr "" msgid "%sremote[%s]: unable to create socket" msgstr "" +#, c-format +msgid "%sremote[%s]: gnutls: failed to initialize certificate structure" +msgstr "" + +#, c-format +msgid "remote[%s]: gnutls: receiving %d certificate" +msgid_plural "remote[%s]: gnutls: receiving %d certificates" +msgstr[0] "" +msgstr[1] "" + +#, c-format +msgid "%sremote[%s]: gnutls: failed to import certificate[%d]" +msgstr "" + +#, c-format +msgid "remote[%s] - certificate[%d] info:" +msgstr "" + +#, c-format +msgid "%sremote[%s]: gnutls: certificate has expired" +msgstr "" + +#, c-format +msgid "%sremote[%s]: gnutls: certificate is not yet activated" +msgstr "" + +#, c-format +msgid "" +"%sremote[%s]: gnutls: the hostname in the certificate does NOT match \"%s\"" +msgstr "" + +#, c-format +msgid "%sremote[%s]: gnutls: error while checking peer's certificate" +msgstr "" + +#, c-format +msgid "%sremote[%s]: gnutls: peer's certificate is NOT trusted" +msgstr "" + +#, c-format +msgid "remote[%s]: gnutls: peer's certificate is trusted" +msgstr "" + +#, c-format +msgid "%sremote[%s]: gnutls: peer's certificate issuer is unknown" +msgstr "" + +#, c-format +msgid "%sremote[%s]: gnutls: the certificate has been revoked" +msgstr "" + #, c-format msgid "%sremote[%s]: handshake failed with URL %s, response code: %s" msgstr "" diff --git a/src/plugins/relay/api/remote/relay-remote-network.c b/src/plugins/relay/api/remote/relay-remote-network.c index ff4145b8f..b076a6c43 100644 --- a/src/plugins/relay/api/remote/relay-remote-network.c +++ b/src/plugins/relay/api/remote/relay-remote-network.c @@ -26,7 +26,9 @@ #include #include #include + #include +#include #include #include "../../../weechat-plugin.h" @@ -53,23 +55,18 @@ char * relay_remote_network_get_url_resource (struct t_relay_remote *remote, const char *resource) { - const char *ptr_url; - char url[4096]; + char *url; - if (!remote || !resource || !resource[0]) + if (!remote || !remote->address || !resource || !resource[0]) return NULL; - ptr_url = weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]); - if (!ptr_url || !ptr_url[0]) - return NULL; + weechat_asprintf (&url, "%s://%s:%d/api/%s", + (remote->tls) ? "https" : "http", + remote->address, + remote->port, + resource); - snprintf (url, sizeof (url), - "%s%sapi/%s", - ptr_url, - (ptr_url[strlen (ptr_url) - 1] == '/') ? "" : "/", - resource); - - return strdup (url); + return url; } /* @@ -931,6 +928,233 @@ relay_remote_network_connect_cb (const void *pointer, void *data, int status, return WEECHAT_RC_OK; } +/* + * GnuTLS callback called during handshake. + * + * Returns: + * 0: certificate OK + * -1: error in certificate + */ + +int +relay_remote_network_gnutls_callback (const void *pointer, void *data, + gnutls_session_t tls_session, + const gnutls_datum_t *req_ca, int nreq, + const gnutls_pk_algorithm_t *pk_algos, + int pk_algos_len, +#if LIBGNUTLS_VERSION_NUMBER >= 0x020b00 /* 2.11.0 */ + gnutls_retr2_st *answer, +#else + gnutls_retr_st *answer, +#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020b00 */ + int action) +{ + struct t_relay_remote *remote; + gnutls_x509_crt_t cert_temp; + const gnutls_datum_t *cert_list; + unsigned int i, cert_list_len, status; + time_t cert_time; + int rc, hostname_match, cert_temp_init; +#if LIBGNUTLS_VERSION_NUMBER >= 0x010706 /* 1.7.6 */ + gnutls_datum_t cinfo; + int rinfo; +#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x010706 */ + + /* make C compiler happy */ + (void) data; + (void) req_ca; + (void) nreq; + (void) pk_algos; + (void) pk_algos_len; + (void) answer; + + rc = 0; + + if (!pointer) + return -1; + + remote = (struct t_relay_remote *) pointer; + cert_temp_init = 0; + cert_list = NULL; + cert_list_len = 0; + + if (action == WEECHAT_HOOK_CONNECT_GNUTLS_CB_VERIFY_CERT) + { + /* initialize the certificate structure */ + if (gnutls_x509_crt_init (&cert_temp) != GNUTLS_E_SUCCESS) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: failed to initialize certificate structure"), + weechat_prefix ("error"), remote->name); + rc = -1; + goto end; + } + + /* flag to do the "deinit" (at the end of function) */ + cert_temp_init = 1; + + /* set match options */ + hostname_match = 0; + + /* get the peer's raw certificate (chain) as sent by the peer */ + cert_list = gnutls_certificate_get_peers (tls_session, &cert_list_len); + if (cert_list) + { + weechat_printf ( + NULL, + NG_("remote[%s]: gnutls: receiving %d certificate", + "remote[%s]: gnutls: receiving %d certificates", + cert_list_len), + remote->name, + cert_list_len); + + for (i = 0; i < cert_list_len; i++) + { + if (gnutls_x509_crt_import (cert_temp, + &cert_list[i], + GNUTLS_X509_FMT_DER) != GNUTLS_E_SUCCESS) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: failed to import certificate[%d]"), + weechat_prefix ("error"), remote->name, i + 1); + rc = -1; + goto end; + } + + /* checks on first certificate received */ + if (i == 0) + { + /* check if hostname matches in the first certificate */ + if (gnutls_x509_crt_check_hostname (cert_temp, + remote->address) != 0) + { + hostname_match = 1; + } + } +#if LIBGNUTLS_VERSION_NUMBER >= 0x010706 /* 1.7.6 */ + /* display infos about certificate */ +#if LIBGNUTLS_VERSION_NUMBER < 0x020400 /* 2.4.0 */ + rinfo = gnutls_x509_crt_print (cert_temp, + GNUTLS_X509_CRT_ONELINE, &cinfo); +#else + rinfo = gnutls_x509_crt_print (cert_temp, + GNUTLS_CRT_PRINT_ONELINE, &cinfo); +#endif /* LIBGNUTLS_VERSION_NUMBER < 0x020400 */ + if (rinfo == 0) + { + weechat_printf ( + NULL, + _("remote[%s] - certificate[%d] info:"), + remote->name, i + 1); + weechat_printf ( + NULL, + "remote[%s] - %s", + remote->name, cinfo.data); + gnutls_free (cinfo.data); + } +#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x010706 */ + /* check expiration date */ + cert_time = gnutls_x509_crt_get_expiration_time (cert_temp); + if (cert_time < time (NULL)) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: certificate has expired"), + weechat_prefix ("error"), remote->name); + rc = -1; + } + /* check activation date */ + cert_time = gnutls_x509_crt_get_activation_time (cert_temp); + if (cert_time > time (NULL)) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: certificate is not yet activated"), + weechat_prefix ("error"), remote->name); + rc = -1; + } + } + + if (!hostname_match) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: the hostname in the certificate " + "does NOT match \"%s\""), + weechat_prefix ("error"), remote->name, remote->address); + rc = -1; + } + } + + /* verify the peer’s certificate */ + if (gnutls_certificate_verify_peers2 (tls_session, &status) < 0) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: error while checking peer's certificate"), + weechat_prefix ("error"), remote->name); + rc = -1; + goto end; + } + + /* check if certificate is trusted */ + if (status & GNUTLS_CERT_INVALID) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: peer's certificate is NOT trusted"), + weechat_prefix ("error"), remote->name); + rc = -1; + } + else + { + weechat_printf ( + NULL, + _("remote[%s]: gnutls: peer's certificate is trusted"), + remote->name); + } + + /* check if certificate issuer is known */ + if (status & GNUTLS_CERT_SIGNER_NOT_FOUND) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: peer's certificate issuer is unknown"), + weechat_prefix ("error"), remote->name); + rc = -1; + } + + /* check that certificate is not revoked */ + if (status & GNUTLS_CERT_REVOKED) + { + weechat_printf ( + NULL, + _("%sremote[%s]: gnutls: the certificate has been revoked"), + weechat_prefix ("error"), remote->name); + rc = -1; + } + } + else if (action == WEECHAT_HOOK_CONNECT_GNUTLS_CB_SET_CERT) + { + /* nothing here */ + } + +end: + /* an error should stop the handshake unless the user doesn't care */ + if ((rc == -1) + && !weechat_config_boolean (remote->options[RELAY_REMOTE_OPTION_TLS_VERIFY])) + { + rc = 0; + } + + if (cert_temp_init) + gnutls_x509_crt_deinit (cert_temp); + + return rc; +} + /* * Callback for handshake URL. */ @@ -953,6 +1177,8 @@ relay_remote_network_url_handshake_cb (const void *pointer, remote = (struct t_relay_remote *)pointer; + remote->hook_url_handshake = NULL; + ptr_resp_code = weechat_hashtable_get (output, "response_code"); if (ptr_resp_code && ptr_resp_code[0] && (strcmp (ptr_resp_code, "200") != 0)) { @@ -962,6 +1188,7 @@ relay_remote_network_url_handshake_cb (const void *pointer, remote->name, weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]), ptr_resp_code); + relay_remote_set_status (remote, RELAY_STATUS_DISCONNECTED); return WEECHAT_RC_OK; } @@ -974,6 +1201,7 @@ relay_remote_network_url_handshake_cb (const void *pointer, remote->name, weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]), ptr_error); + relay_remote_set_status (remote, RELAY_STATUS_DISCONNECTED); return WEECHAT_RC_OK; } @@ -1009,6 +1237,7 @@ relay_remote_network_url_handshake_cb (const void *pointer, remote->name, weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]), _("hash algorithm not found")); + relay_remote_set_status (remote, RELAY_STATUS_DISCONNECTED); return WEECHAT_RC_OK; } @@ -1020,6 +1249,7 @@ relay_remote_network_url_handshake_cb (const void *pointer, remote->name, weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]), _("unknown number of hash iterations")); + relay_remote_set_status (remote, RELAY_STATUS_DISCONNECTED); return WEECHAT_RC_OK; } @@ -1031,6 +1261,7 @@ relay_remote_network_url_handshake_cb (const void *pointer, remote->name, weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]), _("unknown TOTP status")); + relay_remote_set_status (remote, RELAY_STATUS_DISCONNECTED); return WEECHAT_RC_OK; } @@ -1053,10 +1284,10 @@ relay_remote_network_url_handshake_cb (const void *pointer, remote->port, 1, /* ipv6 */ 0, /* retry */ - NULL, /* gnutls_sess */ - NULL, /* gnutls_cb */ - 0, /* gnutls_dhkey_size */ - NULL, /* gnutls_priorities */ + (remote->tls) ? &remote->gnutls_sess : NULL, + (remote->tls) ? &relay_remote_network_gnutls_callback : NULL, + 2048, /* gnutls_dhkey_size */ + "NORMAL", /* gnutls_priorities */ NULL, /* local_hostname */ &relay_remote_network_connect_cb, remote, @@ -1151,6 +1382,11 @@ relay_remote_network_connect (struct t_relay_remote *remote) "httpheader", "Accept: application/json\n" "Content-Type: application/json; charset=utf-8"); + if (!weechat_config_boolean (remote->options[RELAY_REMOTE_OPTION_TLS_VERIFY])) + { + weechat_hashtable_set (options, "ssl_verifypeer", "0"); + weechat_hashtable_set (options, "ssl_verifyhost", "0"); + } body = relay_remote_network_get_handshake_request (); if (!body) goto error; diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c index 728f65019..8ebdf7118 100644 --- a/src/plugins/relay/relay-command.c +++ b/src/plugins/relay/relay-command.c @@ -400,13 +400,16 @@ relay_command_display_remote (struct t_relay_remote *remote, int with_detail) weechat_printf (NULL, ""); weechat_printf (NULL, _("Remote: %s"), remote->name); weechat_printf (NULL, " url. . . . . . . . . : '%s'", - weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL])); + weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL])); weechat_printf (NULL, " proxy. . . . . . . . : '%s'", - weechat_config_string (remote->options[RELAY_REMOTE_OPTION_PROXY])); + weechat_config_string (remote->options[RELAY_REMOTE_OPTION_PROXY])); + weechat_printf (NULL, " tls_verify . . . . . : %s", + (weechat_config_string (remote->options[RELAY_REMOTE_OPTION_TLS_VERIFY])) ? + "on" : "off"); weechat_printf (NULL, " password . . . . . . : '%s'", - weechat_config_string (remote->options[RELAY_REMOTE_OPTION_PASSWORD])); + weechat_config_string (remote->options[RELAY_REMOTE_OPTION_PASSWORD])); weechat_printf (NULL, " totp_secret. . . . . : '%s'", - weechat_config_string (remote->options[RELAY_REMOTE_OPTION_TOTP_SECRET])); + weechat_config_string (remote->options[RELAY_REMOTE_OPTION_TOTP_SECRET])); } else { @@ -429,7 +432,7 @@ relay_command_remote (const void *pointer, void *data, { struct t_relay_remote *ptr_remote, *ptr_remote2; int i, detailed_list, one_remote_found; - const char *ptr_proxy, *ptr_password, *ptr_totp_secret; + const char *ptr_proxy, *ptr_tls_verify, *ptr_password, *ptr_totp_secret; char *remote_name; /* make C compiler happy */ @@ -531,6 +534,7 @@ relay_command_remote (const void *pointer, void *data, return WEECHAT_RC_OK; } ptr_proxy = NULL; + ptr_tls_verify = NULL; ptr_password = NULL; ptr_totp_secret = NULL; for (i = 4; i < argc; i++) @@ -539,6 +543,10 @@ relay_command_remote (const void *pointer, void *data, { ptr_proxy = argv[i] + 7; } + else if (strncmp (argv[i], "-tls_verify=", 12) == 0) + { + ptr_tls_verify = argv[i] + 12; + } else if (strncmp (argv[i], "-password=", 10) == 0) { ptr_password = argv[i] + 10; @@ -558,7 +566,8 @@ relay_command_remote (const void *pointer, void *data, } } ptr_remote = relay_remote_new (argv[2], argv[3], ptr_proxy, - ptr_password, ptr_totp_secret); + ptr_tls_verify, ptr_password, + ptr_totp_secret); if (ptr_remote) { weechat_printf (NULL, _("Remote relay \"%s\" created"), argv[2]); @@ -846,7 +855,7 @@ relay_command_init () "list %(relay_remotes)" " || listfull %(relay_remotes)" " || add %(relay_remotes) https://localhost:9000 " - "-password=${xxx}|-proxy=xxx|-totp_secret=${xxx}|%*" + "-password=${xxx}|-proxy=xxx|-tls_verify=xxx|-totp_secret=${xxx}|%*" " || connect %(relay_remotes)" " || send %(relay_remotes) {\"request\":\"\"}" " || disconnect %(relay_remotes)" diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c index d2511267a..fd4d12e16 100644 --- a/src/plugins/relay/relay-config.c +++ b/src/plugins/relay/relay-config.c @@ -1077,6 +1077,14 @@ relay_config_create_remote_option (const char *remote_name, int index_option, NULL, 0, 0, value, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); break; + case RELAY_REMOTE_OPTION_TLS_VERIFY: + ptr_option = weechat_config_new_option ( + relay_config_file, relay_config_section_remote, + option_name, "boolean", + N_("check that the TLS connection is fully trusted"), + NULL, 0, 0, value, NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + break; case RELAY_REMOTE_OPTION_PASSWORD: ptr_option = weechat_config_new_option ( relay_config_file, relay_config_section_remote, diff --git a/src/plugins/relay/relay-remote.c b/src/plugins/relay/relay-remote.c index fb4072bbe..9b49bbb61 100644 --- a/src/plugins/relay/relay-remote.c +++ b/src/plugins/relay/relay-remote.c @@ -42,9 +42,9 @@ char *relay_remote_option_string[RELAY_REMOTE_NUM_OPTIONS] = -{ "url", "proxy", "password", "totp_secret" }; +{ "url", "proxy", "tls_verify", "password", "totp_secret" }; char *relay_remote_option_default[RELAY_REMOTE_NUM_OPTIONS] = -{ "", "", "", "" }; +{ "", "", "on", "", "" }; struct t_relay_remote *relay_remotes = NULL; struct t_relay_remote *last_relay_remote = NULL; @@ -266,20 +266,34 @@ relay_remote_get_address (const char *url) int relay_remote_get_port (const char *url) { - char *pos, *error; + char *pos, *pos2, *str_port, *error; long port; if (!url) goto error; - pos = strrchr (url, ':'); + pos = strchr (url + 7, ':'); if (!pos) goto error; + pos++; + + pos2 = strchr (pos, '/'); + if (pos2) + str_port = weechat_strndup (pos, pos2 - pos); + else + str_port = strdup (pos); + if (!str_port) + goto error; + error = NULL; - port = strtol (pos + 1, &error, 10); + port = strtol (str_port, &error, 10); if (error && !error[0]) + { + free (str_port); return (int)port; + } + free (str_port); error: return RELAY_REMOTE_DEFAULT_PORT; @@ -403,6 +417,7 @@ relay_remote_set_url (struct t_relay_remote *remote, const char *url) free (remote->address); remote->address = relay_remote_get_address (url); remote->port = relay_remote_get_port (url); + remote->tls = (weechat_strncmp (url, "https:", 6) == 0) ? 1 : 0; } /* @@ -451,7 +466,8 @@ relay_remote_new_with_options (const char *name, struct t_config_option **option struct t_relay_remote * relay_remote_new (const char *name, const char *url, const char *proxy, - const char *password, const char *totp_secret) + const char *tls_verify, const char *password, + const char *totp_secret) { struct t_config_option *option[RELAY_REMOTE_NUM_OPTIONS]; const char *value[RELAY_REMOTE_NUM_OPTIONS]; @@ -463,6 +479,7 @@ relay_remote_new (const char *name, const char *url, const char *proxy, value[RELAY_REMOTE_OPTION_URL] = url; value[RELAY_REMOTE_OPTION_PROXY] = proxy; + value[RELAY_REMOTE_OPTION_TLS_VERIFY] = tls_verify; value[RELAY_REMOTE_OPTION_PASSWORD] = password; value[RELAY_REMOTE_OPTION_TOTP_SECRET] = totp_secret; @@ -471,7 +488,7 @@ relay_remote_new (const char *name, const char *url, const char *proxy, option[i] = relay_config_create_remote_option ( name, i, - (value[i]) ? value[i] : ""); + (value[i]) ? value[i] : relay_remote_option_string[i]); } new_remote = relay_remote_new_with_options (name, option); @@ -922,6 +939,9 @@ relay_remote_print_log () weechat_config_string (ptr_remote->options[RELAY_REMOTE_OPTION_URL])); weechat_log_printf (" proxy . . . . . . . . . : '%s'", weechat_config_string (ptr_remote->options[RELAY_REMOTE_OPTION_PROXY])); + weechat_log_printf (" tls_verify. . . . . . . : %s", + (weechat_config_boolean (ptr_remote->options[RELAY_REMOTE_OPTION_TLS_VERIFY])) ? + "on" : "off"); weechat_log_printf (" password. . . . . . . . : '%s'", weechat_config_string (ptr_remote->options[RELAY_REMOTE_OPTION_PASSWORD])); weechat_log_printf (" totp_secret . . . . . . : '%s'", diff --git a/src/plugins/relay/relay-remote.h b/src/plugins/relay/relay-remote.h index 30c408946..87db6583e 100644 --- a/src/plugins/relay/relay-remote.h +++ b/src/plugins/relay/relay-remote.h @@ -26,10 +26,11 @@ enum t_relay_remote_option { - RELAY_REMOTE_OPTION_URL = 0, /* remote URL */ - RELAY_REMOTE_OPTION_PROXY, /* proxy used for remote (optional) */ - RELAY_REMOTE_OPTION_PASSWORD, /* password for remote relay */ - RELAY_REMOTE_OPTION_TOTP_SECRET, /* TOTP secret for remote relay */ + RELAY_REMOTE_OPTION_URL = 0, /* remote URL */ + RELAY_REMOTE_OPTION_PROXY, /* proxy used for remote (optional) */ + RELAY_REMOTE_OPTION_TLS_VERIFY, /* check if the connection is trusted */ + RELAY_REMOTE_OPTION_PASSWORD, /* password for remote relay */ + RELAY_REMOTE_OPTION_TOTP_SECRET, /* TOTP secret for remote relay */ /* number of relay remote options */ RELAY_REMOTE_NUM_OPTIONS, }; @@ -86,6 +87,7 @@ extern struct t_relay_remote *relay_remote_new_with_options (const char *name, struct t_config_option **options); extern struct t_relay_remote *relay_remote_new (const char *name, const char *proxy, + const char *tls_verify, const char *url, const char *password, const char *totp_secret); diff --git a/tests/unit/plugins/relay/api/remote/test-relay-remote-network.cpp b/tests/unit/plugins/relay/api/remote/test-relay-remote-network.cpp index 5e3eb3880..fd5913f2c 100644 --- a/tests/unit/plugins/relay/api/remote/test-relay-remote-network.cpp +++ b/tests/unit/plugins/relay/api/remote/test-relay-remote-network.cpp @@ -54,9 +54,9 @@ TEST_GROUP(RelayRemoteNetworkWithRemote) /* create two relay remotes */ ptr_relay_remote = relay_remote_new ("remote", "http://localhost:9000", - NULL, "secret", "secretbase32"); + NULL, "on", "secret", "secretbase32"); ptr_relay_remote2 = relay_remote_new ("remote2", "https://localhost:9001/", - "my_proxy", "secret", "secretbase32"); + "my_proxy", "off", "secret", "secretbase32"); } void teardown ()