fix: Make it OK if the chain isn't avilable during bad-ssl querying

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-05-23 09:38:15 +01:00
parent a912d4db4e
commit dd43748676
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
3 changed files with 33 additions and 22 deletions

View File

@ -2199,7 +2199,7 @@ static bool fetch_about_query_privacy_handler(struct fetch_about_context *ctx)
const char *title;
struct nsurl *siteurl = NULL;
char *description = NULL;
const char *chainurl = "";
const char *chainurl = NULL;
const struct fetch_multipart_data *curmd; /* mutipart data iterator */
/* extract parameters from multipart post data */
@ -2261,16 +2261,24 @@ static bool fetch_about_query_privacy_handler(struct fetch_about_context *ctx)
goto fetch_about_query_ssl_handler_aborted;
}
}
res = ssenddataf(ctx,
"<div><p>%s</p></div>"
"<div><p><a href=\"%s\" target=\"_blank\">%s</a></p></div>",
reason,
chainurl,
messages_get("ViewCertificates"));
if (chainurl == NULL) {
res = ssenddataf(ctx,
"<div><p>%s</p></div>"
"<div><p>%s</p></div>",
reason,
messages_get("ViewCertificatesNotPossible"));
} else {
res = ssenddataf(ctx,
"<div><p>%s</p></div>"
"<div><p><a href=\"%s\" target=\"_blank\">%s</a></p></div>",
reason,
chainurl,
messages_get("ViewCertificates"));
}
if (res != NSERROR_OK) {
goto fetch_about_query_ssl_handler_aborted;
}
res = ssenddataf(ctx,
"<div id=\"buttons\">"
"<input type=\"submit\" id=\"back\" name=\"back\" "

View File

@ -1149,6 +1149,18 @@ browser_window__handle_bad_certs(struct browser_window *bw,
break;
}
}
err = cert_chain_to_query(bw->loading_cert_chain, &chainurl);
if (err != NSERROR_OK) {
goto out;
}
err = fetch_multipart_data_new_kv(&params.post_multipart,
"chainurl",
nsurl_access(chainurl));
if (err != NSERROR_OK) {
goto out;
}
}
err = fetch_multipart_data_new_kv(&params.post_multipart,
@ -1158,20 +1170,6 @@ browser_window__handle_bad_certs(struct browser_window *bw,
goto out;
}
err = cert_chain_to_query(bw->loading_cert_chain, &chainurl);
if (err != NSERROR_OK) {
goto out;
}
err = fetch_multipart_data_new_kv(&params.post_multipart,
"chainurl",
nsurl_access(chainurl));
if (err != NSERROR_OK) {
goto out;
}
/* Now we issue the fetch */
bw->internal_nav = true;
err = browser_window__navigate_internal(bw, &params);

View File

@ -1083,6 +1083,11 @@ de.all.ViewCertificates:Zertifikatdetails anzeigen
fr.all.ViewCertificates:Afficher les détails du certificat
it.all.ViewCertificates:Visualizza i dettagli del certificato
nl.all.ViewCertificates:Bekijk certificaatdetails
en.all.ViewCertificatesNotPossible:Certificate information is not available for viewing
de.all.ViewCertificatesNotPossible:Zertifikatinformationen können nicht angezeigt werden
fr.all.ViewCertificatesNotPossible:Les informations du certificat ne sont pas disponibles pour la visualisation
it.all.ViewCertificatesNotPossible:Le informazioni sul certificato non sono disponibili per la visualizzazione
nl.all.ViewCertificatesNotPossible:Certificaatinformatie is niet beschikbaar voor weergave
en.all.Proceed:Proceed
de.all.Proceed:Vorgehen
fr.all.Proceed:Procéder