patch for dillo and openssl 1.1

Globe Trotter <itsme_410-/[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
Hello,
Dillo's https stopped working on F26. It turned out that that was because of the move to openssl v1.1. The kind folks (in particular Matias Ellert) made a patch for F26 which works for both the old version of dillo with openssl v1.0 and v1.1. 

I am including his patch here in case there is interest in merging this upstream (which is the best place to put it).
Best wishes!

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev
dillo-openssl.patch (text/x-patch, 1.7 KB)
diff -ur dillo-3.0.5.orig/configure.ac dillo-3.0.5/configure.ac
--- dillo-3.0.5.orig/configure.ac	2015-06-30 16:07:06.000000000 +0200
+++ dillo-3.0.5/configure.ac	2017-09-11 15:51:57.910529543 +0200
@@ -286,7 +286,7 @@
 
   if test "x$ssl_ok" = "xyes"; then
     old_libs="$LIBS"
-    AC_CHECK_LIB(ssl, SSL_library_init, ssl_ok=yes, ssl_ok=no, -lcrypto)
+    AC_CHECK_LIB(ssl, SSL_write, ssl_ok=yes, ssl_ok=no, -lcrypto)
     LIBS="$old_libs"
   fi
 
diff -ur dillo-3.0.5.orig/dpi/https.c dillo-3.0.5/dpi/https.c
--- dillo-3.0.5.orig/dpi/https.c	2015-06-30 16:06:08.000000000 +0200
+++ dillo-3.0.5/dpi/https.c	2017-09-11 16:03:39.862924064 +0200
@@ -443,6 +443,7 @@
    char buf[4096], *d_cmd, *msg;
 
    X509 * remote_cert;
+   char * remote_cert_name;
 
    remote_cert = SSL_get_peer_certificate(ssl_connection);
    if (remote_cert == NULL){
@@ -476,7 +477,9 @@
       case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
          /*Either self signed and untrusted*/
          /*Extract CN from certificate name information*/
-         if ((cn = strstr(remote_cert->name, "/CN=")) == NULL) {
+         remote_cert_name =
+            X509_NAME_oneline(X509_get_subject_name(remote_cert), NULL, 0);
+         if ((cn = strstr(remote_cert_name, "/CN=")) == NULL) {
             strcpy(buf, "(no CN given)");
          } else {
             char *cn_end;
@@ -489,6 +492,7 @@
             strncpy(buf, cn, (size_t) (cn_end - cn));
             buf[cn_end - cn] = '\0';
          }
+         OPENSSL_free(remote_cert_name);
          msg = dStrconcat("The remote certificate is self-signed and "
                           "untrusted.\nFor address: ", buf, NULL);
          d_cmd = a_Dpip_build_cmd(
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.