1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-02 08:57:19 -04:00

Merge pull request #52 from guidocella/https-by-default

Let requests default to https
This commit is contained in:
rkd77 2020-06-25 18:40:22 +02:00 committed by GitHub
commit 76df3571f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -203,6 +203,11 @@ connection\&.ssl\&.cert_verify \fB[0|1]\fR (default: 0)
.RS 4 .RS 4
Verify the peer\'s SSL certificate\&. Note that this needs extensive configuration of OpenSSL by the user\&. Verify the peer\'s SSL certificate\&. Note that this needs extensive configuration of OpenSSL by the user\&.
.RE .RE
.PP
connection\&.ssl\&.https_by_default \fB[0|1]\fR (default: 0)
.RS 4
Use HTTPS when a URL scheme is not provided\&.
.RE
.SS "connection\&.ssl\&.client_cert (Client Certificates)" .SS "connection\&.ssl\&.client_cert (Client Certificates)"
X509 client certificate options\&. X509 client certificate options\&.
.PP .PP

View File

@ -118,6 +118,10 @@ static union option_info openssl_options[] = {
N_("Verify the peer's SSL certificate. Note that this " N_("Verify the peer's SSL certificate. Note that this "
"needs extensive configuration of OpenSSL by the user.")), "needs extensive configuration of OpenSSL by the user.")),
INIT_OPT_BOOL("connection.ssl", N_("Use HTTPS by default"),
"https_by_default", 0, 0,
N_("Use HTTPS when a URL scheme is not provided.")),
INIT_OPT_TREE("connection.ssl", N_("Client Certificates"), INIT_OPT_TREE("connection.ssl", N_("Client Certificates"),
"client_cert", OPT_SORT, "client_cert", OPT_SORT,
N_("X509 client certificate options.")), N_("X509 client certificate options.")),

View File

@ -1242,6 +1242,11 @@ parse_uri:
break; break;
case PROTOCOL_HTTP: case PROTOCOL_HTTP:
#ifdef CONFIG_SSL
if (get_opt_bool("connection.ssl.https_by_default", NULL))
add_to_string(&str, "https://");
else
#endif
add_to_string(&str, "http://"); add_to_string(&str, "http://");
add_to_string(&str, newurl); add_to_string(&str, newurl);
break; break;