Skip to content

Commit 2657bcf

Browse files
committed
Revert ignoring ssl proxy errors, doesn't make a difference
1 parent 86ad7d6 commit 2657bcf

File tree

7 files changed

+25
-73
lines changed

7 files changed

+25
-73
lines changed

src/backend/internal/proxy-host.js

-10
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ const internalProxyHost = {
4848
// At this point the domains should have been checked
4949
data.owner_user_id = access.token.getUserId(1);
5050

51-
// Ignoring upstream ssl errors only applies when upstream scheme is https
52-
if (data.forward_scheme === 'http') {
53-
data.ignore_invalid_upstream_ssl = false;
54-
}
55-
5651
return proxyHostModel
5752
.query()
5853
.omit(omissions())
@@ -170,11 +165,6 @@ const internalProxyHost = {
170165
domain_names: row.domain_names
171166
}, data);
172167

173-
// Ignoring upstream ssl errors only applies when upstream scheme is https
174-
if (typeof data.forward_scheme !== 'undefined' && data.forward_scheme === 'http') {
175-
data.ignore_invalid_upstream_ssl = false;
176-
}
177-
178168
return proxyHostModel
179169
.query()
180170
.where({id: data.id})

src/backend/migrations/20181213013211_forward_scheme.js

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ exports.up = function (knex/*, Promise*/) {
1717

1818
return knex.schema.table('proxy_host', function (proxy_host) {
1919
proxy_host.string('forward_scheme').notNull().defaultTo('http');
20-
proxy_host.integer('ignore_invalid_upstream_ssl').notNull().unsigned().defaultTo(0);
2120
})
2221
.then(() => {
2322
logger.info('[' + migrate_name + '] proxy_host Table altered');

src/backend/schema/endpoints/proxy-hosts.json

-14
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@
5252
"example": true,
5353
"type": "boolean"
5454
},
55-
"ignore_invalid_upstream_ssl": {
56-
"description": "Ignore invalid upstream SSL certificates",
57-
"example": true,
58-
"type": "boolean"
59-
},
6055
"access_list_id": {
6156
"$ref": "../definitions.json#/definitions/access_list_id"
6257
},
@@ -107,9 +102,6 @@
107102
"allow_websocket_upgrade": {
108103
"$ref": "#/definitions/allow_websocket_upgrade"
109104
},
110-
"ignore_invalid_upstream_ssl": {
111-
"$ref": "#/definitions/ignore_invalid_upstream_ssl"
112-
},
113105
"access_list_id": {
114106
"$ref": "#/definitions/access_list_id"
115107
},
@@ -188,9 +180,6 @@
188180
"allow_websocket_upgrade": {
189181
"$ref": "#/definitions/allow_websocket_upgrade"
190182
},
191-
"ignore_invalid_upstream_ssl": {
192-
"$ref": "#/definitions/ignore_invalid_upstream_ssl"
193-
},
194183
"access_list_id": {
195184
"$ref": "#/definitions/access_list_id"
196185
},
@@ -252,9 +241,6 @@
252241
"allow_websocket_upgrade": {
253242
"$ref": "#/definitions/allow_websocket_upgrade"
254243
},
255-
"ignore_invalid_upstream_ssl": {
256-
"$ref": "#/definitions/ignore_invalid_upstream_ssl"
257-
},
258244
"access_list_id": {
259245
"$ref": "#/definitions/access_list_id"
260246
},

src/backend/templates/proxy_host.conf

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ server {
2323

2424
{% include "_forced_ssl.conf" %}
2525

26-
{% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
27-
proxy_set_header Upgrade $http_upgrade;
28-
proxy_set_header Connection "upgrade";
29-
proxy_http_version 1.1;
30-
{% endif %}
26+
{% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
27+
proxy_set_header Upgrade $http_upgrade;
28+
proxy_set_header Connection "upgrade";
29+
proxy_http_version 1.1;
30+
{% endif %}
3131

3232
# Proxy!
3333
include conf.d/include/proxy.conf;

src/frontend/js/app/nginx/proxy/form.ejs

+1-11
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</label>
6060
</div>
6161
</div>
62-
<div class="col-sm-6 col-md-6">
62+
<div class="col-sm-12 col-md-12">
6363
<div class="form-group">
6464
<label class="custom-switch">
6565
<input type="checkbox" class="custom-switch-input" name="allow_websocket_upgrade" value="1"<%- allow_websocket_upgrade ? ' checked' : '' %>>
@@ -69,16 +69,6 @@
6969
</div>
7070
</div>
7171

72-
<div class="col-sm-6 col-md-6">
73-
<div class="form-group">
74-
<label class="custom-switch">
75-
<input type="checkbox" class="custom-switch-input" name="ignore_invalid_upstream_ssl" value="1"<%- ignore_invalid_upstream_ssl ? ' checked' : '' %>>
76-
<span class="custom-switch-indicator"></span>
77-
<span class="custom-switch-description"><%- i18n('proxy-hosts', 'ignore-invalid-upstream-ssl') %></span>
78-
</label>
79-
</div>
80-
</div>
81-
8272
<div class="col-sm-12 col-md-12">
8373
<div class="form-group">
8474
<label class="form-label"><%- i18n('proxy-hosts', 'access-list') %></label>

src/frontend/js/app/nginx/proxy/form.js

-12
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,10 @@ module.exports = Mn.View.extend({
2727
ssl_forced: 'input[name="ssl_forced"]',
2828
http2_support: 'input[name="http2_support"]',
2929
forward_scheme: 'select[name="forward_scheme"]',
30-
ignore_ssl: 'input[name="ignore_invalid_upstream_ssl"]',
3130
letsencrypt: '.letsencrypt'
3231
},
3332

3433
events: {
35-
'change @ui.forward_scheme': function () {
36-
let val = this.ui.forward_scheme.val();
37-
this.ui.ignore_ssl
38-
.prop('disabled', val === 'http')
39-
.parents('.form-group')
40-
.css('opacity', val === 'https' ? 1 : 0.5);
41-
},
42-
4334
'change @ui.certificate_select': function () {
4435
let id = this.ui.certificate_select.val();
4536
if (id === 'new') {
@@ -71,7 +62,6 @@ module.exports = Mn.View.extend({
7162
data.block_exploits = !!data.block_exploits;
7263
data.caching_enabled = !!data.caching_enabled;
7364
data.allow_websocket_upgrade = !!data.allow_websocket_upgrade;
74-
data.ignore_invalid_upstream_ssl = data.forward_scheme === 'https' ? !!data.ignore_invalid_upstream_ssl : false;
7565

7666
if (typeof data.ssl_forced !== 'undefined' && data.ssl_forced === '1') {
7767
data.ssl_forced = true;
@@ -215,8 +205,6 @@ module.exports = Mn.View.extend({
215205
view.ui.certificate_select[0].selectize.setValue(view.model.get('certificate_id'));
216206
}
217207
});
218-
219-
this.ui.forward_scheme.trigger('change');
220208
},
221209

222210
initialize: function (options) {

src/frontend/js/models/proxy-host.js

+19-20
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,26 @@ const model = Backbone.Model.extend({
77

88
defaults: function () {
99
return {
10-
id: undefined,
11-
created_on: null,
12-
modified_on: null,
13-
domain_names: [],
14-
forward_scheme: 'http',
15-
forward_host: '',
16-
forward_port: null,
17-
access_list_id: 0,
18-
certificate_id: 0,
19-
ssl_forced: false,
20-
caching_enabled: false,
21-
allow_websocket_upgrade: false,
22-
block_exploits: false,
23-
http2_support: false,
24-
ignore_invalid_upstream_ssl: false,
25-
advanced_config: '',
26-
meta: {},
10+
id: undefined,
11+
created_on: null,
12+
modified_on: null,
13+
domain_names: [],
14+
forward_scheme: 'http',
15+
forward_host: '',
16+
forward_port: null,
17+
access_list_id: 0,
18+
certificate_id: 0,
19+
ssl_forced: false,
20+
caching_enabled: false,
21+
allow_websocket_upgrade: false,
22+
block_exploits: false,
23+
http2_support: false,
24+
advanced_config: '',
25+
meta: {},
2726
// The following are expansions:
28-
owner: null,
29-
access_list: null,
30-
certificate: null
27+
owner: null,
28+
access_list: null,
29+
certificate: null
3130
};
3231
}
3332
});

0 commit comments

Comments
 (0)