File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
src/plugins/console/server Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ import _ from 'lodash';
2121import http from 'http' ;
2222import https from 'https' ;
2323import url from 'url' ;
24- import { Duration } from 'moment' ;
2524
26- const createAgent = ( legacyConfig : any ) => {
25+ import { ESConfigForProxy } from '../types' ;
26+
27+ const createAgent = ( legacyConfig : ESConfigForProxy ) => {
2728 const target = url . parse ( _ . head ( legacyConfig . hosts ) ) ;
2829 if ( ! / ^ h t t p s / . test ( target . protocol || '' ) ) return new http . Agent ( ) ;
2930
@@ -59,7 +60,7 @@ const createAgent = (legacyConfig: any) => {
5960 return new https . Agent ( agentOptions ) ;
6061} ;
6162
62- export const getElasticsearchProxyConfig = ( legacyConfig : { requestTimeout : Duration } ) => {
63+ export const getElasticsearchProxyConfig = ( legacyConfig : ESConfigForProxy ) => {
6364 return {
6465 timeout : legacyConfig . requestTimeout . asMilliseconds ( ) ,
6566 agent : createAgent ( legacyConfig ) ,
Original file line number Diff line number Diff line change @@ -60,9 +60,7 @@ export class ConsoleServerPlugin implements Plugin<ConsoleSetup> {
6060 const legacyConfig = readLegacyEsConfig ( ) ;
6161 return {
6262 ...elasticsearch ,
63- hosts : legacyConfig . hosts ,
64- requestHeadersWhitelist : legacyConfig . requestHeadersWhitelist ,
65- customHeaders : legacyConfig . customHeaders ,
63+ ...legacyConfig ,
6664 } ;
6765 } ,
6866 pathFilters : proxyPathFilters ,
Original file line number Diff line number Diff line change @@ -31,4 +31,12 @@ export interface ESConfigForProxy {
3131 requestHeadersWhitelist : string [ ] ;
3232 customHeaders : Record < string , any > ;
3333 requestTimeout : Duration ;
34+ ssl ?: {
35+ verificationMode : 'none' | 'certificate' | 'full' ;
36+ certificateAuthorities : string [ ] | string ;
37+ alwaysPresentCertificate : boolean ;
38+ certificate ?: string ;
39+ key ?: string ;
40+ keyPassphrase ?: string ;
41+ } ;
3442}
You can’t perform that action at this time.
0 commit comments