aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-02-11 08:21:04 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-02-11 10:37:21 +0000
commit492dcb182aeebc559cb0ae18ac5dba197862515b (patch)
tree5317b26c4435f43af13d133b4fcb536fb25726b4 /main.c
parentTypo fix for ssl_cipher (diff)
downloadw3m-492dcb182aeebc559cb0ae18ac5dba197862515b.tar.gz
w3m-492dcb182aeebc559cb0ae18ac5dba197862515b.zip
New option -insecure to use insecure SSL config options
Alias for `-o ssl_cipher=ALL:@SECLEVEL=0 -o ssl_min_version=all -o ssl_forbid_method= -o ssl_verify_server=0`.
Diffstat (limited to '')
-rw-r--r--main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.c b/main.c
index bbdf3c3..096ab09 100644
--- a/main.c
+++ b/main.c
@@ -247,6 +247,9 @@ fusage(FILE * f, int err)
fprintf(f, " -4 IPv4 only (-o dns_order=4)\n");
fprintf(f, " -6 IPv6 only (-o dns_order=6)\n");
#endif
+#ifdef USE_SSL
+ fprintf(f, " -insecure use insecure SSL config options\n");
+#endif
#ifdef USE_MOUSE
fprintf(f, " -no-mouse don't use mouse\n");
#endif /* USE_MOUSE */
@@ -752,6 +755,18 @@ main(int argc, char **argv, char **envp)
displayTitleTerm = getenv("TERM");
else if (!strncmp("-title=", argv[i], 7))
displayTitleTerm = argv[i] + 7;
+#ifdef USE_SSL
+ else if (!strcmp("-insecure", argv[i])) {
+ set_param_option("ssl_cipher=ALL:@SECLEVEL=0");
+#ifdef SSL_CTX_set_min_proto_version
+ set_param_option("ssl_min_version=all");
+#endif
+ set_param_option("ssl_forbid_method=");
+#ifdef USE_SSL_VERIFY
+ set_param_option("ssl_verify_server=0");
+#endif
+ }
+#endif /* USE_SSL */
else if (!strcmp("-o", argv[i]) ||
!strcmp("-show-option", argv[i])) {
if (!strcmp("-show-option", argv[i]) || ++i >= argc ||