Bill Gribble's ssl patch.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3731 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-03-01 23:55:24 +00:00
parent 929c6f682b
commit e003198a66
5 changed files with 51 additions and 4 deletions

View File

@ -69,6 +69,7 @@
#undef HAVE_LIBGTKHTML
#undef HAVE_LIBGHTTP
#undef HAVE_OPENSSL
/* misc image and compression libs needed by html widget */
#undef HAVE_ZLIB

View File

@ -327,6 +327,10 @@ AC_CHECK_LIB(ghttp, ghttp_request_new,
AC_MSG_ERROR([Cannot find ghttp. See the README for more info.]),
$GHTTP_LIBS)
AC_CHECK_LIB(ghttp, ghttp_enable_ssl,
AC_DEFINE(HAVE_OPENSSL),
AC_MSG_WARN([ghttp does not have SSL support.]),
$GHTTP_LIBS)
AC_SUBST(GTKHTML_LIBS)
AC_SUBST(GTKHTML_CFLAGS)

View File

@ -24,8 +24,22 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef HAVE_OPENSSL
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <ghttp_ssl.h>
#endif
#include <ghttp.h>
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-embedded.h>
#ifdef USE_GUPPI
@ -34,7 +48,6 @@
#include <gnome.h>
#include <regex.h>
#include <glib.h>
#include <ghttp.h>
#include <guile/gh.h>
#include "Account.h"
@ -413,6 +426,18 @@ ghttp_check_callback(gpointer data) {
}
}
#ifdef HAVE_OPENSSL
static int
gnc_html_certificate_check_cb(ghttp_request * req, X509 * cert,
void * user_data) {
printf("gnc-html: checking SSL certificate...\n");
X509_print_fp(stdout, cert);
printf(" ... done\n");
return TRUE;
}
#endif
static void
gnc_html_start_request(gnc_html * html, gchar * uri, GtkHTMLStream * handle) {
@ -421,6 +446,12 @@ gnc_html_start_request(gnc_html * html, gchar * uri, GtkHTMLStream * handle) {
info->request = ghttp_request_new();
info->handle = handle;
info->uri = g_strdup (uri);
#ifdef HAVE_OPENSSL
ghttp_enable_ssl(info->request);
ghttp_set_ssl_certificate_callback(info->request,
gnc_html_certificate_check_cb,
(void *)html);
#endif
ghttp_set_uri(info->request, uri);
ghttp_set_header(info->request, http_hdr_User_Agent,
"gnucash/1.5 (Financial Browser for Linux; http://gnucash.org)");

View File

@ -218,7 +218,12 @@ gnc_help_window_reload_button_cb(GtkWidget * w, gpointer data) {
static void
goto_string_cb(char * string, gpointer data) {
strncpy(data, string, 250);
if(string) {
strncpy(data, string, 250);
}
else if(data) {
*(char *)data = 0;
}
}
static int

View File

@ -672,13 +672,19 @@
(begin
(set! all-ok #f)
(errormsg
(list "Parse ambiguity : between formats "
(with-output-to-string
(lambda ()
(for-each
(lambda (elt)
(display elt))
(list
"Parse ambiguity : between formats "
formats "\nValue " unparsed " could be "
(printer parsed) " or "
(printer this-parsed)
"\nand no evidence exists to distinguish."
"\nUsing " (printer parsed) ". "
"\nSee help for more info."))))))
"\nSee help for more info.")))))))))
(cdr formats))))
(if (and all-ok (not (null? (cdr objlist))))
(obj-loop (cdr objlist)))))