summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--windows/main.c27
l---------windows/res/ca-bundle.crt1
-rw-r--r--windows/res/installer.nsi3
3 files changed, 30 insertions, 1 deletions
diff --git a/windows/main.c b/windows/main.c
index f4eec12e3..7a23f711c 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -98,6 +98,33 @@ static nserror set_defaults(struct nsoption_s *defaults)
{
/* Set defaults for absent option strings */
+ /* locate CA bundle and set as default, cannot rely on curl
+ * compiled in default on windows.
+ */
+ DWORD res_len;
+ DWORD buf_tchar_size = PATH_MAX + 1;
+ DWORD buf_bytes_size = sizeof(TCHAR) * buf_tchar_size;
+ char *ptr = NULL;
+
+ char *buf;
+
+ buf = malloc(buf_bytes_size);
+ if (buf== NULL) {
+ return NSERROR_NOMEM;
+ }
+ buf[0] = '\0';
+
+ res_len = SearchPathA(NULL,
+ "ca-bundle.crt",
+ NULL,
+ buf_tchar_size,
+ buf,
+ &ptr);
+ if (res_len > 0) {
+ nsoption_setnull_charp(ca_bundle, strdup(buf));
+ }
+ free(buf);
+
/* ensure homepage option has a default */
nsoption_setnull_charp(homepage_url, strdup(NETSURF_HOMEPAGE));
diff --git a/windows/res/ca-bundle.crt b/windows/res/ca-bundle.crt
new file mode 120000
index 000000000..ad2dd6b55
--- /dev/null
+++ b/windows/res/ca-bundle.crt
@@ -0,0 +1 @@
+../../!NetSurf/Resources/ca-bundle \ No newline at end of file
diff --git a/windows/res/installer.nsi b/windows/res/installer.nsi
index a934533ee..a65478420 100644
--- a/windows/res/installer.nsi
+++ b/windows/res/installer.nsi
@@ -8,7 +8,7 @@
!define DESCRIPTION "Web Browser"
# These three must be integers
!define VERSIONMAJOR 3
-!define VERSIONMINOR 0
+!define VERSIONMINOR 4
!define VERSIONBUILD 1
# These will be displayed by the "Click here for support information" link in "Add/Remove Programs"
# It is possible to use "mailto:" links in here to open the email client
@@ -62,6 +62,7 @@ section "install"
file /oname=welcome.html "windows\res\welcome.html"
file /oname=netsurf.png "windows\res\netsurf.png"
file /oname=messages "build-Linux-windows\messages"
+ file /oname=ca-bundle.crt "windows\res\ca-bundle.crt"
# Add any other files for the install directory (license files, app data, etc) here
# Uninstaller - See function un.onInit and section "uninstall" for configuration