Re: Again about the slow startup with SSL enabled.
John Found <[email protected]>
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <[email protected]> |
OK. In the attachment is my barbarous patch that significantly accelerates Dillo3.1-dev startup time. Actually, the logic deleted is this kind of logic that creates most of the bloatware in the universe. In attempt to support all possible options, it loads the certificates from several places that are actually symlinks to the same location. This way all the certificates are loaded several times each. Then the whole list is searched and duplicated certificates are removed by calling Tls_remove_duplicate_certificates(). Anyway, the patch contains one more fix - the wrong positioning in the page, when the URL contains local anchor: mysite.com/page/file#local This problem was discussed back in 2015 (http://lists.dillo.org/pipermail/dillo-dev/2015-February/010472.html) but AFAIK was never fixed officially and the only working trick is what is in the patch. It may (or may not) have some side effects. For me it works fine. Hope, this patch will be useful for someone. Regards John Found On Mon, 20 Dec 2021 21:50:42 +0100 Diego <[email protected]> wrote: > I suggest a temporal workaround. > > You can install a dillo without ssl to read documents and compile > another with ssl. Then Copy the second like dillo-ssl and use for > https only. > The rest of files (*rc, dpi, etc) do not need a copy or second instalation. > > Please post here too if you find another workaround > > Diego > > > 2021-12-20 18:14 GMT+01:00, John Found <[email protected]>: > > On Mon, 20 Dec 2021 07:35:12 -0800 > > peter-zuKqHHl9LF8sA/[email protected] wrote: > > > >> Even with Tls_load_certificates() Dillo is significantly faster than > >> Firefox. > > > > Well, yes it is. But I really want it to be *instantly fast* and I > > believe it is possible and not so hard. Actually v3.0.5 even with SSL > > enabled is much faster. > > > > Well, I will try to search for some solution on the mbedtls web site > > and forums and will try to fix this problem somehow. > > > > Regards. > > John Found > > > > > > _______________________________________________ > > Dillo-dev mailing list > > [email protected] > > http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev > > http://www.dillo.org/ > > You get this email because your address [email protected] is in the > > mailing list dillo-dev. > > -- John Found <[email protected]> _______________________________________________ Dillo-dev mailing list [email protected] http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev http://www.dillo.org/ You get this email because your address [email protected] is in the mailing list dillo-dev.
quick_start.patch
(application/octet-stream, 2.6 KB)
diff -r 67b70f024568 src/IO/tls.c
--- a/src/IO/tls.c Tue Feb 09 22:15:42 2021 +0100
+++ b/src/IO/tls.c Tue Dec 21 12:26:09 2021 +0200
@@ -253,62 +253,8 @@
*/
static void Tls_load_certificates()
{
- /* curl-7.37.1 says that the following bundle locations are used on "Debian
- * systems", "Redhat and Mandriva", "old(er) Redhat", "FreeBSD", and
- * "OpenBSD", respectively -- and that the /etc/ssl/certs/ path is needed on
- * "SUSE". No doubt it's all changed some over time, but this gives us
- * something to work with.
- */
- uint_t u;
- char *userpath;
- mbedtls_x509_crt *curr;
-
- static const char *const ca_files[] = {
- "/etc/ssl/certs/ca-certificates.crt",
- "/etc/pki/tls/certs/ca-bundle.crt",
- "/usr/share/ssl/certs/ca-bundle.crt",
- "/usr/local/share/certs/ca-root.crt",
- "/etc/ssl/cert.pem",
- CA_CERTS_FILE
- };
-
- static const char *const ca_paths[] = {
- "/etc/ssl/certs/",
- CA_CERTS_DIR
- };
-
- for (u = 0; u < sizeof(ca_files)/sizeof(ca_files[0]); u++) {
- if (*ca_files[u])
- Tls_load_certificates_from_file(ca_files[u]);
- }
-
- for (u = 0; u < sizeof(ca_paths)/sizeof(ca_paths[0]); u++) {
- if (*ca_paths[u]) {
- Tls_load_certificates_from_path(ca_paths[u]);
- }
- }
-
- userpath = dStrconcat(dGethomedir(), "/.dillo/certs/", NULL);
- Tls_load_certificates_from_path(userpath);
- dFree(userpath);
-
- Tls_remove_duplicate_certificates();
-
- /* Count our trusted certificates */
- u = 0;
- if (cacerts.next) {
- u++;
- for (curr = cacerts.next; curr; curr = curr->next)
- u++;
- } else {
- mbedtls_x509_crt empty;
- mbedtls_x509_crt_init(&empty);
-
- if (memcmp(&cacerts, &empty, sizeof(mbedtls_x509_crt)))
- u++;
- }
-
- MSG("Trusting %u TLS certificate%s.\n", u, u==1 ? "" : "s");
+ /* KISS - /etc/ssl/cert.pem is a symlink that can be always set properly! */
+ Tls_load_certificates_from_file("/etc/ssl/cert.pem");
}
/*
diff -r 67b70f024568 src/nav.c
--- a/src/nav.c Tue Feb 09 22:15:42 2021 +0100
+++ b/src/nav.c Tue Dec 21 12:26:09 2021 +0200
@@ -304,8 +304,8 @@
goto_old_scroll = FALSE;
if (repush) {
Nav_get_scroll_pos(bw, &posx, &posy);
- if (posx || posy)
- goto_old_scroll = TRUE;
+// if (posx || posy)
+// goto_old_scroll = TRUE;
} else if (e2equery) {
/* Reset scroll, so repush goes to fragment in the next pass */
Nav_save_scroll_pos(bw, a_Nav_stack_ptr(bw), 0, 0);