-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect to Elasticsearch via SSL when starting kibana with --ssl
#42840
Changes from 2 commits
c0328cb
0cd5741
bb69162
d1f98d4
5526d38
26efc20
507007e
eceb4c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
import _ from 'lodash'; | ||
import { statSync } from 'fs'; | ||
import { resolve } from 'path'; | ||
import { CA_CERT_PATH } from '@kbn/dev-utils'; | ||
|
||
import { fromRoot, IS_KIBANA_DISTRIBUTABLE } from '../../legacy/utils'; | ||
import { getConfig } from '../../legacy/server/path'; | ||
|
@@ -94,6 +95,14 @@ function applyConfigOverrides(rawConfig, opts, extraCliOptions) { | |
set('server.ssl.certificate', DEV_SSL_CERT_PATH); | ||
set('server.ssl.key', DEV_SSL_KEY_PATH); | ||
} | ||
|
||
if (opts.ssl && !opts.elasticsearch && !has('elasticsearch.hosts')) { | ||
set('elasticsearch.hosts', 'https://localhost:9200'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem to be the best way to hardcode the host. Maybe there's a better way to do this? Or to findout if Elasticsearch is running on a different port? Note the certificate within There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
} | ||
|
||
if (opts.ssl && !has('elasticsearch.ssl.certificateAuthorities')) { | ||
set('elasticsearch.ssl.certificateAuthorities', CA_CERT_PATH); | ||
} | ||
} | ||
|
||
if (opts.elasticsearch) set('elasticsearch.hosts', opts.elasticsearch.split(',')); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we okay shipping dev certs? i know there's quite a bit in this file that makes it tough and extends beyond the scope of this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should only be requiring this when
opts.dev
is true so that we don't have to ship@kbn/dev-utils
in the distributable.