Include UnsafeSSL checkbox for insecureSkipVerify

pull/758/head
Andrew Watkins 2017-01-11 14:42:00 -08:00
parent 7573807804
commit f10db6d3da
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,2 @@
export const insecureSkipVerifyText = `Unsafe SSL controls whether a client verifies the server's certificate chain and host name. \n
If checked, TLS accepts any certificate presented by the server and any host name in that certificate.`;

View File

@ -1,5 +1,6 @@
import React, {PropTypes} from 'react';
import classNames from 'classnames';
import {insecureSkipVerifyText} from 'src/shared/copy/tooltipText';
const {
bool,
@ -27,6 +28,7 @@ export const SourceForm = React.createClass({
password: this.sourcePassword.value,
'default': this.sourceDefault.checked,
telegraf: this.sourceTelegraf.value,
insecureSkipVerify: this.sourceInsecureSkipVerify ? this.sourceInsecureSkipVerify.checked : false,
});
this.props.onSubmit(newSource);
},
@ -85,6 +87,14 @@ export const SourceForm = React.createClass({
<label htmlFor="defaultSourceCheckbox">Make this the default source</label>
</div>
</div>
{source.url.startsWith("https") ?
<div className="form-group col-xs-12">
<div className="form-control-static">
<input type="checkbox" id="insecureSkipVerifyCheckbox" defaultChecked={source.insecureSkipVerify} ref={(r) => this.sourceInsecureSkipVerify = r} />
<label htmlFor="insecureSkipVerifyCheckbox">Unsafe SSL</label>
</div>
<label className="form-helper">{insecureSkipVerifyText}</label>
</div> : null}
<div className="form-group form-group-submit col-xs-12 col-sm-6 col-sm-offset-3">
<button className={classNames('btn btn-block', {'btn-primary': editMode, 'btn-success': !editMode})} type="submit">{editMode ? "Save Changes" : "Add Source"}</button>
</div>